pub trait StateField: Sized {
// Required methods
fn write_field(&self, buf: &mut Vec<u8>);
fn read_field(cursor: &mut StateCursor<'_>) -> Option<Self>;
}Expand description
Trait for types that can be serialized as a single state field.
Implemented for primitives, String, Vec<T>, and Option<T>.
Required Methods§
fn write_field(&self, buf: &mut Vec<u8>)
fn read_field(cursor: &mut StateCursor<'_>) -> Option<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".