Struct listenfd::ListenFdManager [] [src]

pub struct ListenFdManager { /* fields omitted */ }

A helper object that gives access to raw file descriptors.

Methods

impl ListenFdManager
[src]

[src]

Creates the fd manager from the environment.

[src]

Creates an empty fd manager.

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 manager will just never return sockets.

[src]

Returns the number of fds in the manager.

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

[src]

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.

[src]

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.

[src]

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.

[src]

Takes the RawFd on unix platforms.

Trait Implementations

Auto Trait Implementations