pub trait Saveable {
// Required method
fn save(&self, context: Context<'_>) -> Result<Value<'_>>;
}Expand description
Implemented by any value that can be written into a Value.
This is the bottom of the trait hierarchy and is implemented for:
- Primitive numeric types (signed, unsigned, floats,
NonZero*). bool,str,String, andHandle.Option<T>(serializesNoneasValue::Null).&[T]andVec<T>(serialize asValue::Array).- Any
T: Save(wraps the produced record inValue::Objectwith the type’sSave::VERSION).
Most user types should implement Save (which gets a Saveable impl for free
via the blanket below) rather than Saveable directly.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".