Codec

Trait Codec 

Source
pub trait Codec: Sized {
    // Required methods
    fn pack(&self, p: &mut Packer<'_>);
    fn unpack(p: &mut Unpacker<'_>) -> Option<Self>;
}
Expand description

Codec for packing and unpacking SMP command parameters.

Required Methods§

Source

fn pack(&self, p: &mut Packer<'_>)

Packs command parameters into an SMP PDU.

Source

fn unpack(p: &mut Unpacker<'_>) -> Option<Self>

Unpacks command parameters from an SMP PDU.

Implementations should only return None if one of the unpacked values cannot be decoded. The final Unpacker status is checked by the caller.

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§