Skip to main content

Source

Trait Source 

Source
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 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§

Source

fn is_listening(file: BorrowedFd<'_>) -> Result<bool, Self::Listening>

Whether one adopted descriptor is already listening.

Provided Methods§

Source

fn reset<E: From<Errno>>(file: impl AsFd) -> Result<(), E>

Makes closing this exclusively owned connection send a reset.

Source

fn kind<E: From<Errno>>(file: BorrowedFd<'_>) -> Result<Type, E>

Observes the socket type of one adopted descriptor.

Source

fn set_reuse<E: From<Errno>>( file: BorrowedFd<'_>, reuse: Reuse, ) -> Result<(), E>

Admits the requested address reuse on one socket.

Source

fn get_option<const OPTION: c_int, E: From<Errno>>( file: BorrowedFd<'_>, ) -> Result<c_int, E>

Source

fn set_option<E: From<Errno>>( file: BorrowedFd<'_>, level: c_int, option: c_int, value: &c_int, ) -> Result<(), E>

Source

fn option(kind: Kind) -> (c_int, c_int)

Source

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

Implementors§