Struct listenfd::ListenFd [] [src]

pub struct ListenFd { /* fields omitted */ }

A helper object that gives access to raw file descriptors.

Methods

impl ListenFd
[src]

[src]

Creates the listenfd manager object from the environment.

[src]

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.

[src]

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.

[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

impl Send for ListenFd

impl Sync for ListenFd