Trait domain::base::wire::Compose

source ·
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§

source

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§

source

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.

Implementations on Foreign Types§

source§

impl Compose for i8

source§

const COMPOSE_LEN: u16 = 1u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for i16

source§

const COMPOSE_LEN: u16 = 2u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for i32

source§

const COMPOSE_LEN: u16 = 4u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for i64

source§

const COMPOSE_LEN: u16 = 8u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for i128

source§

const COMPOSE_LEN: u16 = 16u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for u8

source§

const COMPOSE_LEN: u16 = 1u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for u16

source§

const COMPOSE_LEN: u16 = 2u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for u32

source§

const COMPOSE_LEN: u16 = 4u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for u64

source§

const COMPOSE_LEN: u16 = 8u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl Compose for u128

source§

const COMPOSE_LEN: u16 = 16u16

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl<'a, T: Compose + ?Sized> Compose for &'a T

source§

const COMPOSE_LEN: u16 = T::COMPOSE_LEN

source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

Implementors§