pub trait WritablePduWithOneInput<I, ErrorType> {
const BASE_LENGTH: usize;
// Required methods
fn len(&self, input: I) -> usize;
fn write<T: Write>(
&self,
_writer: &mut T,
input: I,
) -> 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, input: I) -> usize
fn len(&self, input: I) -> 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, input: I) -> Result<(), ErrorType>where
Self: Sized,
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.