pub struct Listener { /* private fields */ }Expand description
Multiplexer listener.
Implementations
sourceimpl 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 !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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
