Typed conversion contract used by script state and method parameter conversion. Implement this trait for custom structs/enums (typically via `#[derive(Variant)]`).
| 316 | /// |
| 317 | /// Implement this trait for custom structs/enums (typically via `#[derive(Variant)]`). |
| 318 | pub trait DeriveVariant: Sized { |
| 319 | fn from_variant(value: &Variant) -> Option<Self>; |
| 320 | fn from_owned_variant(value: Variant) -> Option<Self> { |
| 321 | Self::from_variant(&value) |
| 322 | } |
| 323 | fn to_variant(&self) -> Variant; |
| 324 | fn into_variant(self) -> Variant { |
| 325 | self.to_variant() |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | /// Optional compile-time introspection metadata for Variant-derived types. |
| 330 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected