pub enum Listener {
Unix(UnixListener),
Tcp(TcpListener),
NamedPipe(OsString),
}
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()?;
let listener = binding.try_into()?;
assert!(matches!(listener, Listener::Tcp(_)));
Variants§
Unix(UnixListener)
Listener for a Unix domain socket.
Tcp(TcpListener)
Listener for a TCP socket.
NamedPipe(OsString)
Named Pipe.
Trait Implementations§
Source§impl From<TcpListener> for Listener
impl From<TcpListener> for Listener
Source§fn from(listener: TcpListener) -> Self
fn from(listener: TcpListener) -> Self
Converts to this type from the input type.
Source§impl From<UnixListener> for Listener
impl From<UnixListener> for Listener
Source§fn from(listener: UnixListener) -> Self
fn from(listener: UnixListener) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Listener
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin for Listener
impl UnwindSafe for Listener
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more