pub enum ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> {
OutboundSubstreamRequest(TOutboundOpenInfo),
Custom(TCustom),
}
Expand description
Event produced by a handler.
Variants§
OutboundSubstreamRequest(TOutboundOpenInfo)
Require a new outbound substream to be opened with the remote.
Custom(TCustom)
Other event.
Implementations§
Source§impl<TOutboundOpenInfo, TCustom> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Event produced by a handler.
impl<TOutboundOpenInfo, TCustom> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Event produced by a handler.
Sourcepub fn map_outbound_open_info<F, I>(
self,
map: F,
) -> ConnectionHandlerEvent<I, TCustom>where
F: FnOnce(TOutboundOpenInfo) -> I,
pub fn map_outbound_open_info<F, I>(
self,
map: F,
) -> ConnectionHandlerEvent<I, TCustom>where
F: FnOnce(TOutboundOpenInfo) -> I,
If this is OutboundSubstreamRequest
, maps the content to something else.
Sourcepub fn map_custom<F, I>(
self,
map: F,
) -> ConnectionHandlerEvent<TOutboundOpenInfo, I>where
F: FnOnce(TCustom) -> I,
pub fn map_custom<F, I>(
self,
map: F,
) -> ConnectionHandlerEvent<TOutboundOpenInfo, I>where
F: FnOnce(TCustom) -> I,
If this is Custom
, maps the content to something else.
Trait Implementations§
Source§impl<TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Source§fn clone(&self) -> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
fn clone(&self) -> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Returns a duplicate 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<TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Source§impl<TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Source§fn eq(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
fn eq(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl<TOutboundOpenInfo: Copy, TCustom: Copy> Copy for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Eq, TCustom: Eq> Eq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> StructuralPartialEq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Auto Trait Implementations§
impl<TOutboundOpenInfo, TCustom> Freeze for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> RefUnwindSafe for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>where
TOutboundOpenInfo: RefUnwindSafe,
TCustom: RefUnwindSafe,
impl<TOutboundOpenInfo, TCustom> Send for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> Sync for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> Unpin for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> UnwindSafe for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>where
TOutboundOpenInfo: UnwindSafe,
TCustom: 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§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