Skip to main content

Mode

Trait Mode 

Source
pub trait Mode: Sized {
    type Capability;

    // Required methods
    fn acquire() -> Option<Self::Capability>;
    fn control(cap: Self::Capability, size: NonZero<u16>) -> Self;
    fn release(self) -> (Self::Capability, NonZero<u16>);
    fn bytes(&mut self) -> &[u8] ⓘ;
}
Expand description

Segmentation capability and its borrowed ancillary storage.

Required Associated Types§

Required Methods§

Source

fn acquire() -> Option<Self::Capability>

Source

fn control(cap: Self::Capability, size: NonZero<u16>) -> Self

Source

fn release(self) -> (Self::Capability, NonZero<u16>)

Source

fn bytes(&mut self) -> &[u8] ⓘ

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Mode for Infallible

Source§

type Capability = !

Source§

fn acquire() -> Option<Self::Capability>

Source§

fn control(cap: Self::Capability, _: NonZero<u16>) -> Self

Source§

fn release(self) -> (Self::Capability, NonZero<u16>)

Source§

fn bytes(&mut self) -> &[u8] ⓘ

Implementors§