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.
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.