Trait SerializeValue

Source
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§

Source

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

Source

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.

Implementations on Foreign Types§

Source§

impl SerializeValue for bool

Source§

impl SerializeValue for f32

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for f64

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for i8

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for i16

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for i32

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for i64

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Source§

impl SerializeValue for u8

Source§

fn read_value<R: StreamingReader>( reader: &mut R, ) -> Result<Self, DecodeValueError<R::Error>>

Source§

fn write_value<W: StreamingWriter>( val: Self, writer: &mut W, ) -> Result<(), W::Error>

Implementors§