pub struct Listener { /* private fields */ }
Expand description
Multiplexer listener.
Implementations§
source§impl Listener
impl Listener
sourcepub fn port_allocator(&self) -> PortAllocator
pub fn port_allocator(&self) -> PortAllocator
Obtains the port allocator.
sourcepub async fn accept(
&mut self
) -> Result<Option<(Sender, Receiver)>, ListenerError>
pub async fn accept( &mut self ) -> Result<Option<(Sender, Receiver)>, ListenerError>
Accept a connection returning the sender and receiver for the opened port.
Returns None when the client of the remote endpoint has been dropped and no more connection requests can be made.
sourcepub async fn inspect(&mut self) -> Result<Option<Request>, ListenerError>
pub async fn inspect(&mut self) -> Result<Option<Request>, ListenerError>
Obtains the next connection request from the remote endpoint.
Connection requests can be stored and accepted or rejected at a later time. The maximum number of unanswered connection requests is specified in the configuration. If this number is reached, the remote endpoint will not send any more connection requests.
Returns None when the client of the remote endpoint has been dropped and no more connection requests can be made.
sourcepub fn into_stream(self) -> ListenerStream
pub fn into_stream(self) -> ListenerStream
Convert this into a listener stream.
Trait Implementations§
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