pub trait SegmentEncode {
type PDUType;
// Required methods
fn encoded_len(&self, file_size_flag: FileSizeFlag) -> u16;
fn encode(self, file_size_flag: FileSizeFlag) -> Vec<u8> ⓘ;
fn decode<T: Read>(
buffer: &mut T,
segmentation_flag: SegmentedData,
file_size_flag: FileSizeFlag,
) -> PDUResult<Self::PDUType>;
}Expand description
Provides utility functions for encoding and decoding byte streams For PDUs which require knowledge of the Segmentation state
Required Associated Types§
Required Methods§
Sourcefn encoded_len(&self, file_size_flag: FileSizeFlag) -> u16
fn encoded_len(&self, file_size_flag: FileSizeFlag) -> u16
Gets the encoded length must fit in a u16 for PDUs
Sourcefn decode<T: Read>(
buffer: &mut T,
segmentation_flag: SegmentedData,
file_size_flag: FileSizeFlag,
) -> PDUResult<Self::PDUType>
fn decode<T: Read>( buffer: &mut T, segmentation_flag: SegmentedData, file_size_flag: FileSizeFlag, ) -> 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".