Skip to main content

ImplMarshal

Trait ImplMarshal 

Source
pub trait ImplMarshal: ImplCommandMsg {
    // Required method
    fn marshal(&self, dst: &mut [u8]) -> Result<usize, MarshalerError>;
}
Expand description

Payload serialization half of Marshaler.

Automatically implemented for any type that implements Marshaler. Implement this trait directly — without implementing Marshaler — to create an encode-only type that does not support deserialization.

Used as the bound on Messager::pack.

Required Methods§

Source

fn marshal(&self, dst: &mut [u8]) -> Result<usize, MarshalerError>

See Marshaler::marshal for details.

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§