pub enum Listener {
    Unix(UnixListener),
    Tcp(TcpListener),
}
Expand description

Opened service listener.

This structure contains an already open listener. Note that the listeners are set to non-blocking mode.

Examples

let binding: Binding = "tcp://127.0.0.1:8080".parse().unwrap();
let listener = binding.try_into().unwrap();
assert!(matches!(listener, Listener::Tcp(_)));

Variants

Unix(UnixListener)

Listener for a Unix domain socket.

Tcp(TcpListener)

Listener for a TCP socket.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.