pub struct ListenFd { /* private fields */ }
Expand description

A helper object that gives access to raw file descriptors.

Implementations

Creates the listenfd manager object from the environment.

Creates an empty listenfd object.

This is helpful when the ability to work with external file descriptors should be disabled in certain code paths. This way the functions on the object will just never return sockets.

Returns the number of fds in the manager object.

Note that even if fds are taken out of the manager this count does not change.

Takes the TCP listener at an index.

If the given index has been used before Ok(None) is returned, otherwise the fd at that index is returned as TcpListener. If the fd at that position is not a tcp socket then an error is returned and the fd is left at its place.

Takes the UNIX listener at an index.

If the given index has been used before Ok(None) is returned, otherwise the fd at that index is returned as UnixListener. If the fd at that position is not a tcp socket then an error is returned and the fd is left at its place.

This function is only available on unix platforms.

Takes the UDP socket at an index.

If the given index has been used before Ok(None) is returned, otherwise the fd at that index is returned as UdpSocket. If the fd at that position is not a tcp socket then an error is returned and the fd is left at its place.

Takes the RawFd on unix platforms.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.