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
sourceimpl<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
sourceimpl<T> Clone for StreamMuxerEvent<T> where
T: Clone,
impl<T> Clone for StreamMuxerEvent<T> where
T: Clone,
sourcepub fn clone(&self) -> StreamMuxerEvent<T>
pub fn clone(&self) -> StreamMuxerEvent<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Debug for StreamMuxerEvent<T> where
T: Debug,
impl<T> Debug for StreamMuxerEvent<T> where
T: Debug,
sourceimpl<T> PartialEq<StreamMuxerEvent<T>> for StreamMuxerEvent<T> where
T: PartialEq<T>,
impl<T> PartialEq<StreamMuxerEvent<T>> for StreamMuxerEvent<T> where
T: PartialEq<T>,
sourcepub fn eq(&self, other: &StreamMuxerEvent<T>) -> bool
pub fn eq(&self, other: &StreamMuxerEvent<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &StreamMuxerEvent<T>) -> bool
pub fn ne(&self, other: &StreamMuxerEvent<T>) -> bool
This method tests for !=
.
impl<T> Eq for StreamMuxerEvent<T> where
T: Eq,
impl<T> StructuralEq for StreamMuxerEvent<T>
impl<T> StructuralPartialEq for StreamMuxerEvent<T>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more