pub trait SignalValue: Sized {
type Surrogate<'a>: Serialize
where Self: 'a;
// Required methods
fn surrogate(&self) -> Self::Surrogate<'_>;
fn from_value(value: &Value) -> Option<Self>;
}Expand description
A value that can be sent to the browser and restored from browser state.
Implemented automatically for runtime types whose surrogates support serialization and deserialization.
Required Associated Types§
Required Methods§
Sourcefn from_value(value: &Value) -> Option<Self>
fn from_value(value: &Value) -> Option<Self>
Reads a value back from the surrogate a client sent, or None if
the surrogate does not fit this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".