pub trait SerializeValue: Sized {
// Required methods
fn read_value<R: StreamingReader>(
reader: &mut R,
) -> Result<Self, DecodeValueError<R::Error>>;
fn write_value<W: StreamingWriter>(
val: Self,
writer: &mut W,
) -> Result<(), W::Error>;
}
Expand description
Value serialization helper trait, oriented towards primitives.
Required Methods§
Sourcefn read_value<R: StreamingReader>(
reader: &mut R,
) -> Result<Self, DecodeValueError<R::Error>>
fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>
Use a StreamingReader to produce an instance of the implementing type from an encoded stream of LCM data
Sourcefn write_value<W: StreamingWriter>(
val: Self,
writer: &mut W,
) -> Result<(), W::Error>
fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>
Use a StreamingWriter to write an instance of the implementing type to an encoded stream of LCM data
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.