Struct gain_listener::Listener[][src]

pub struct Listener {
    pub addr: Binding,
    // some fields omitted
}

Connection listener.

Fields

addr: Binding

Implementations

impl Listener[src]

pub async fn bind_tls(opt: BindOptions<'_>) -> Result<Self, BindError>[src]

Listen to TLS connections at BindOptions::port. The fully-qualified DNS name can be discovered from the Listener::addr.hostname field.

If specified, BindOptions::prefix is prepended to the server name. Its length must be between 1 and 31 characters (inclusive), and it must consist of lowercase alphanumeric ASCII characters and dash (-). It must not start or end with a dash. It must not start with xn--.

pub async fn accept(&mut self) -> Result<Conn, AcceptError>[src]

Accept a client connection. An AcceptErrorKind::Closed error may occur due to environmental causes.

pub fn split(self) -> (Acceptor, CloseStream)[src]

Detach the closing functionality. When the CloseStream is closed or dropped, the Acceptor will return an AcceptErrorKind::Closed error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.