PDUEncode

Trait PDUEncode 

Source
pub trait PDUEncode {
    type PDUType;

    // Required methods
    fn encoded_len(&self) -> u16;
    fn encode(self) -> Vec<u8> ;
    fn decode<T: Read>(buffer: &mut T) -> PDUResult<Self::PDUType>;
}
Expand description

Provides utility functions for encoding and decoding byte streams

Required Associated Types§

Required Methods§

Source

fn encoded_len(&self) -> u16

Gets the encoded length must fit in a u16 for PDUs

Source

fn encode(self) -> Vec<u8>

Encodes the PDU to a byte stream

Source

fn decode<T: Read>(buffer: &mut T) -> PDUResult<Self::PDUType>

Attempts to decode a PDU from a byte stream

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§