pub trait Source: Source {
type Listening;
const KEEP_IDLE: c_int;
// Required method
fn is_listening(file: BorrowedFd<'_>) -> Result<bool, Self::Listening>;
// Provided methods
fn reset<E: From<Errno>>(file: impl AsFd) -> Result<(), E> { ... }
fn kind<E: From<Errno>>(file: BorrowedFd<'_>) -> Result<Type, E> { ... }
fn take_error(file: BorrowedFd<'_>) -> Result<Option<Errno>, Errno> { ... }
fn set_reuse<E: From<Errno>>(
file: BorrowedFd<'_>,
reuse: Reuse,
) -> Result<(), E> { ... }
fn get_option<const OPTION: c_int, E: From<Errno>>(
file: BorrowedFd<'_>,
) -> Result<c_int, E> { ... }
fn set_option<E: From<Errno>>(
file: BorrowedFd<'_>,
level: c_int,
option: c_int,
value: &c_int,
) -> Result<(), E> { ... }
fn option(kind: Kind) -> (c_int, c_int) { ... }
fn set(fd: BorrowedFd<'_>, kind: Kind, value: &Value) -> Result<(), Errno> { ... }
}Expand description
Native socket option selection and access.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn is_listening(file: BorrowedFd<'_>) -> Result<bool, Self::Listening>
fn is_listening(file: BorrowedFd<'_>) -> Result<bool, Self::Listening>
Whether one adopted descriptor is already listening.
Provided Methods§
Sourcefn reset<E: From<Errno>>(file: impl AsFd) -> Result<(), E>
fn reset<E: From<Errno>>(file: impl AsFd) -> Result<(), E>
Makes closing this exclusively owned connection send a reset.
Sourcefn kind<E: From<Errno>>(file: BorrowedFd<'_>) -> Result<Type, E>
fn kind<E: From<Errno>>(file: BorrowedFd<'_>) -> Result<Type, E>
Observes the socket type of one adopted descriptor.
Sourcefn take_error(file: BorrowedFd<'_>) -> Result<Option<Errno>, Errno>
fn take_error(file: BorrowedFd<'_>) -> Result<Option<Errno>, Errno>
Clears the pending socket error and returns its positive errno, if any.
Sourcefn set_reuse<E: From<Errno>>(
file: BorrowedFd<'_>,
reuse: Reuse,
) -> Result<(), E>
fn set_reuse<E: From<Errno>>( file: BorrowedFd<'_>, reuse: Reuse, ) -> Result<(), E>
Admits the requested address reuse on one socket.
fn get_option<const OPTION: c_int, E: From<Errno>>( file: BorrowedFd<'_>, ) -> Result<c_int, E>
fn set_option<E: From<Errno>>( file: BorrowedFd<'_>, level: c_int, option: c_int, value: &c_int, ) -> Result<(), E>
fn option(kind: Kind) -> (c_int, c_int)
fn set(fd: BorrowedFd<'_>, kind: Kind, value: &Value) -> Result<(), Errno>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".