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 a signal can hold: one of the runtime’s vocabulary types, which can be serialized into the page for the browser to pick up and read back from what the browser sends.
Implemented for every type whose surrogate serializes and deserializes; there is nothing to implement by hand.
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".