[][src]Trait fizyr_rpc::util::Listener

pub trait Listener {
    type Connection: Debug;
    type Address: Debug;
    fn poll_accept(
        self: Pin<&mut Self>,
        context: &mut Context<'_>
    ) -> Poll<Result<(Self::Connection, Self::Address)>>; fn accept(&mut self) -> Accept<'_, Self>

Notable traits for Accept<'_, L>

impl<L: ?Sized> Future for Accept<'_, L> where
    L: Listener + Unpin
type Output = Result<(L::Connection, L::Address)>;

    where
        Self: Unpin
, { ... } }

Trait for listeners that can accept new connections.

Associated Types

type Connection: Debug[src]

The type of the connections return by the Self::accept() function.

type Address: Debug[src]

The type of the address returned by the Self::accept() function.

Loading content...

Required methods

fn poll_accept(
    self: Pin<&mut Self>,
    context: &mut Context<'_>
) -> Poll<Result<(Self::Connection, Self::Address)>>
[src]

Try to accept a new connection without blocking.

If no new connection is available, the current task is scheduled to wake up when a new connection is ready.

Loading content...

Provided methods

fn accept(&mut self) -> Accept<'_, Self>

Notable traits for Accept<'_, L>

impl<L: ?Sized> Future for Accept<'_, L> where
    L: Listener + Unpin
type Output = Result<(L::Connection, L::Address)>;
where
    Self: Unpin
[src]

Asynchronously accept a new connection.

Loading content...

Implementations on Foreign Types

impl Listener for TcpListener[src]

type Address = SocketAddr

type Connection = TcpStream

impl Listener for UnixListener[src]

type Address = ()

type Connection = UnixStream

impl Listener for UnixSeqpacketListener[src]

type Address = ()

type Connection = UnixSeqpacket

impl<T: ?Sized> Listener for &mut T where
    T: Listener + Unpin
[src]

type Address = T::Address

type Connection = T::Connection

impl<T: ?Sized> Listener for Box<T> where
    T: Listener + Unpin
[src]

type Address = T::Address

type Connection = T::Connection

impl<P> Listener for Pin<P> where
    P: DerefMut + Unpin,
    P::Target: Listener
[src]

type Address = <P::Target as Listener>::Address

type Connection = <P::Target as Listener>::Connection

Loading content...

Implementors

Loading content...