Skip to main content

Prepare

Trait Prepare 

Source
pub trait Prepare: Socket {
    type Handle: AsFd;
    type Fast;

    // Required methods
    fn fast_open(
        depth: Option<NonZero<i32>>,
    ) -> Result<Option<Self::Fast>, Error>;
    fn open(domain: Domain, kind: Kind) -> Result<Self::Handle, Create>;
    fn listener(domain: Domain) -> Result<Self::Handle, Create>;
    fn adopt(file: OwnedFd) -> Result<Self::Handle, Setup>;
    fn into_fd(handle: Self::Handle) -> OwnedFd;
    fn set_fast(file: BorrowedFd<'_>, fast: Self::Fast) -> Result<(), Errno>;
}
Expand description

Native socket ownership and fast-open support before driver installation.

Required Associated Types§

Required Methods§

Source

fn fast_open(depth: Option<NonZero<i32>>) -> Result<Option<Self::Fast>, Error>

Source

fn open(domain: Domain, kind: Kind) -> Result<Self::Handle, Create>

Source

fn listener(domain: Domain) -> Result<Self::Handle, Create>

Source

fn adopt(file: OwnedFd) -> Result<Self::Handle, Setup>

Source

fn into_fd(handle: Self::Handle) -> OwnedFd

Transfers the prepared socket’s descriptor without changing its native configuration.

Source

fn set_fast(file: BorrowedFd<'_>, fast: Self::Fast) -> Result<(), Errno>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§