pub trait RestorablePrimitive:
Clone
+ PartialEq
+ 'static {
// Required methods
fn from_restoration_data(data: &RestorationData) -> Self;
fn to_restoration_data(&self) -> RestorationData;
}Expand description
A value that is stored in the restoration data as one RestorationData; Dart’s cast
serialized as T in _RestorablePrimitiveValueN.fromPrimitives.
Implemented for the primitives a RestorationBucket can hold and
for Option of each of them, which is the nullable half of Dart’s primitive property pairs.
Required Methods§
Sourcefn from_restoration_data(data: &RestorationData) -> Self
fn from_restoration_data(data: &RestorationData) -> Self
Dart’s serialized as T; panics when the stored data is of another kind, which is what
Dart’s failing cast does.
Sourcefn to_restoration_data(&self) -> RestorationData
fn to_restoration_data(&self) -> RestorationData
The value as it is stored in the restoration data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".