Skip to main content

Encoder

Trait Encoder 

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

    // 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>( &mut self, level: i32, ty: i32, value: T, ) -> Result<usize, Error>
where T: Copy,

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

Implementors§

Source§

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