Enum service_binding::Listener
source · [−]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
sourceimpl From<TcpListener> for Listener
impl From<TcpListener> for Listener
sourcefn from(listener: TcpListener) -> Self
fn from(listener: TcpListener) -> Self
Converts to this type from the input type.
sourceimpl From<UnixListener> for Listener
impl From<UnixListener> for Listener
sourcefn from(listener: UnixListener) -> Self
fn from(listener: UnixListener) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin for Listener
impl UnwindSafe for Listener
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more