[][src]Struct bgb_link::net::listener::BgbListener

pub struct BgbListener { /* fields omitted */ }

Methods

impl BgbListener[src]

pub fn wrap(inner: TcpListener) -> BgbListener[src]

Wraps the given TcpListener and listens for BGB connections.

pub fn accept(&self) -> Result<(BgbStream<TcpStream>, SocketAddr)>[src]

Accepts a connection and performs the BGB handshake before returning. Additionally sets TCP_NODELAY as recommended by the spec. If a bad handshake is received, returns an error of kind InvalidData.

pub fn incoming(&self) -> BgbIncoming[src]

Returns an Iterator equivalent to calling accept in a loop, but without the SocketAddr information. (idk why the standard library just did it like that)

Trait Implementations

impl Debug for BgbListener[src]

Auto Trait Implementations

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.