pub struct CombinedListener<A, B> {
pub a: Option<A>,
pub b: Option<B>,
/* private fields */
}
Expand description
An endpoint that combines two other endpoints
Fields§
§a: Option<A>
First endpoint
b: Option<B>
Second endpoint
Implementations§
Source§impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> CombinedListener<A, B>
impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> CombinedListener<A, B>
Sourcepub fn new(a: Option<A>, b: Option<B>) -> Self
pub fn new(a: Option<A>, b: Option<B>) -> Self
Create a combined listener from two other listeners
When listening for incoming connections with
Listener::accept
, all configured channels will be listened on,
and the first to receive a connection will be used. If no channels are configured,
accept will not throw an error but just wait forever.
Sourcepub fn into_inner(self) -> (Option<A>, Option<B>)
pub fn into_inner(self) -> (Option<A>, Option<B>)
Get back the inner endpoints
Trait Implementations§
Source§impl<A: Clone, B: Clone> Clone for CombinedListener<A, B>
impl<A: Clone, B: Clone> Clone for CombinedListener<A, B>
Source§fn clone(&self) -> CombinedListener<A, B>
fn clone(&self) -> CombinedListener<A, B>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<A: ConnectionErrors, B: ConnectionErrors> ConnectionErrors for CombinedListener<A, B>
impl<A: ConnectionErrors, B: ConnectionErrors> ConnectionErrors for CombinedListener<A, B>
Source§type AcceptError = AcceptError<A, B>
type AcceptError = AcceptError<A, B>
Error when accepting a channel
Source§impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> Listener for CombinedListener<A, B>
impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> Listener for CombinedListener<A, B>
Source§async fn accept(
&self,
) -> Result<(Self::SendSink, Self::RecvStream), Self::AcceptError>
async fn accept( &self, ) -> Result<(Self::SendSink, Self::RecvStream), Self::AcceptError>
Accept a new typed bidirectional channel on any of the connections we
have currently opened.
Source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
The local addresses this endpoint is bound to.
Source§impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> StreamTypes for CombinedListener<A, B>
impl<A: Listener, B: Listener<In = A::In, Out = A::Out>> StreamTypes for CombinedListener<A, B>
Source§type In = <A as StreamTypes>::In
type In = <A as StreamTypes>::In
The type of messages that can be received on the channel
Source§type Out = <A as StreamTypes>::Out
type Out = <A as StreamTypes>::Out
The type of messages that can be sent on the channel
Source§type RecvStream = RecvStream<A, B>
type RecvStream = RecvStream<A, B>
Receive side of a bidirectional typed channel
Auto Trait Implementations§
impl<A, B> Freeze for CombinedListener<A, B>
impl<A, B> RefUnwindSafe for CombinedListener<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for CombinedListener<A, B>
impl<A, B> Sync for CombinedListener<A, B>
impl<A, B> Unpin for CombinedListener<A, B>
impl<A, B> UnwindSafe for CombinedListener<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)