pub enum StreamMuxerEvent<T> {
InboundSubstream(T),
AddressChange(Multiaddr),
}Expand description
Event about a connection, reported by an implementation of StreamMuxer.
Variants§
InboundSubstream(T)
Remote has opened a new substream. Contains the substream in question.
AddressChange(Multiaddr)
Address to the remote has changed. The previous one is now obsolete.
Note: This can for example happen when using the QUIC protocol, where the two nodes can change their IP address while retaining the same QUIC connection.
Implementations§
Source§impl<T> StreamMuxerEvent<T>
impl<T> StreamMuxerEvent<T>
Sourcepub fn into_inbound_substream(self) -> Option<T>
pub fn into_inbound_substream(self) -> Option<T>
If self is a StreamMuxerEvent::InboundSubstream, returns the content. Otherwise
returns None.
Trait Implementations§
Source§impl<T: Clone> Clone for StreamMuxerEvent<T>
impl<T: Clone> Clone for StreamMuxerEvent<T>
Source§fn clone(&self) -> StreamMuxerEvent<T>
fn clone(&self) -> StreamMuxerEvent<T>
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<T: Debug> Debug for StreamMuxerEvent<T>
impl<T: Debug> Debug for StreamMuxerEvent<T>
Source§impl<T: PartialEq> PartialEq for StreamMuxerEvent<T>
impl<T: PartialEq> PartialEq for StreamMuxerEvent<T>
impl<T: Eq> Eq for StreamMuxerEvent<T>
impl<T> StructuralPartialEq for StreamMuxerEvent<T>
Auto Trait Implementations§
impl<T> Freeze for StreamMuxerEvent<T>where
T: Freeze,
impl<T> RefUnwindSafe for StreamMuxerEvent<T>where
T: RefUnwindSafe,
impl<T> Send for StreamMuxerEvent<T>where
T: Send,
impl<T> Sync for StreamMuxerEvent<T>where
T: Sync,
impl<T> Unpin for StreamMuxerEvent<T>where
T: Unpin,
impl<T> UnwindSafe for StreamMuxerEvent<T>where
T: UnwindSafe,
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
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)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more