pub trait Compose {
const COMPOSE_LEN: u16 = 0u16;
// Required method
fn compose<Target: OctetsBuilder + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>;
}
Expand description
An extension trait to add composing to foreign types.
This trait can be used to add the compose
method to a foreign type. For
local types, the method should be added directly to the type instead.
The trait can only be used for types that have a fixed-size wire representation.
Provided Associated Constants§
sourceconst COMPOSE_LEN: u16 = 0u16
const COMPOSE_LEN: u16 = 0u16
The length in octets of the wire representation of a value.
Because all wire format lengths are limited to 16 bit, this is a
u16
rather than a usize
.
Required Methods§
sourcefn compose<Target: OctetsBuilder + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the wire format representation of the value to the target.
Object Safety§
This trait is not object safe.