Trait netgauze_parse_utils::WritablePdu
source · pub trait WritablePdu<ErrorType> {
const BASE_LENGTH: usize;
// Required methods
fn len(&self) -> usize;
fn write<T: Write>(&self, _writer: &mut T) -> Result<(), ErrorType>
where Self: Sized;
}
Expand description
Generic trait for Writable Protocol Data Unit that doesn’t need any external input while writing the packet.
Required Associated Constants§
const BASE_LENGTH: usize
Required Methods§
sourcefn len(&self) -> usize
fn len(&self) -> usize
The total length of the written buffer
Note: the Self::len
might be less than the length value written in
the PDU, since most PDUs don’t include the length of their ‘length’
field in the calculation
fn write<T: Write>(&self, _writer: &mut T) -> Result<(), ErrorType>where
Self: Sized,
Object Safety§
This trait is not object safe.