pub trait MessageField: Sized {
// Required methods
fn to_value(self) -> Value;
fn from_value(v: &Value) -> Option<Self>;
}Expand description
A type a message field can hold: to a Value and back. Implemented
for the numbers, bool, String, Value itself, Option (absent or
null is None) and Vec; #[derive(Message)] implements it for the
type it derives, so one message can carry another.
Required Methods§
fn to_value(self) -> Value
Sourcefn from_value(v: &Value) -> Option<Self>
fn from_value(v: &Value) -> Option<Self>
None for a value of the wrong shape.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".