Encoder

Trait Encoder 

Source
pub trait Encoder {
    // Required method
    fn encode_cmsg<T: Copy>(
        &mut self,
        level: c_int,
        ty: c_int,
        value: T,
    ) -> Result<usize, Error>;

    // Provided methods
    fn encode_ecn(
        &mut self,
        ecn: ExplicitCongestionNotification,
        remote_address: &SocketAddress,
    ) -> Result<usize, Error> { ... }
    fn encode_gso(&mut self, segment_size: u16) -> Result<usize, Error> { ... }
    fn encode_local_address(
        &mut self,
        address: &SocketAddress,
    ) -> Result<usize, Error> { ... }
}

Required Methods§

Source

fn encode_cmsg<T: Copy>( &mut self, level: c_int, ty: c_int, value: T, ) -> Result<usize, Error>

Encodes the given value as a control message in the cmsg buffer.

The msghdr.msg_control should be zero-initialized and aligned and contain enough room for the value to be written.

Provided Methods§

Source

fn encode_ecn( &mut self, ecn: ExplicitCongestionNotification, remote_address: &SocketAddress, ) -> Result<usize, Error>

Encodes ECN markings into the cmsg encoder

Source

fn encode_gso(&mut self, segment_size: u16) -> Result<usize, Error>

Encodes GSO segment_size into the cmsg encoder

Source

fn encode_local_address( &mut self, address: &SocketAddress, ) -> Result<usize, Error>

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.

Implementors§

Source§

impl<const L: usize> Encoder for Encoder<'_, L>