at_commands

Trait SerDe

Source
pub trait SerDe: Sized {
    // Required methods
    fn serialize<W: Write>(
        sink: &mut W,
        values: &[Self],
    ) -> Result<(), SerializeError<Self>>;
    fn deserialize<R: Read>(
        source: &mut R,
        existing_bytes: DeserializeBytes,
    ) -> DeserializeResult<Self>;
}
Expand description

A trait for serializing or deserializing multiple items at once and defragmenting partially serialized items when new bytes become available.

Required Methods§

Source

fn serialize<W: Write>( sink: &mut W, values: &[Self], ) -> Result<(), SerializeError<Self>>

Source

fn deserialize<R: Read>( source: &mut R, existing_bytes: DeserializeBytes, ) -> DeserializeResult<Self>

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.

Implementors§

Source§

impl<T: SerDeOne + Clone> SerDe for T

Blanket implementation for types that implement SerDe and which break bytestreams on newlines when deserializing. This is just used for AT commands and responses.