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§
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>
Sourcefn into_fd(handle: Self::Handle) -> OwnedFd
fn into_fd(handle: Self::Handle) -> OwnedFd
Transfers the prepared socket’s descriptor without changing its native configuration.
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".