pub enum ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> {
OutboundSubstreamRequest {
upgrade: TConnectionUpgrade,
info: TOutboundOpenInfo,
},
Shutdown,
Custom(TCustom),
}
Expand description
Event produced by a handler.
Variants
OutboundSubstreamRequest
Fields
Request a new outbound substream to be opened with the remote.
Shutdown
Perform a graceful shutdown of the connection to the remote.
Should be returned after shutdown()
has been called.
Custom(TCustom)
Other event.
Implementations
sourceimpl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
Event produced by a handler.
sourcepub fn map_outbound_open_info<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom>where
F: FnOnce(TOutboundOpenInfo) -> I,
pub fn map_outbound_open_info<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom>where
F: FnOnce(TOutboundOpenInfo) -> I,
If this is an OutboundSubstreamRequest
, maps the info
member from a TOutboundOpenInfo
to something else.
sourcepub fn map_protocol<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom>where
F: FnOnce(TConnectionUpgrade) -> I,
pub fn map_protocol<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom>where
F: FnOnce(TConnectionUpgrade) -> I,
If this is an OutboundSubstreamRequest
, maps the protocol (TConnectionUpgrade
) to something else.
sourcepub fn map_custom<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, I>where
F: FnOnce(TCustom) -> I,
pub fn map_custom<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, I>where
F: FnOnce(TCustom) -> I,
If this is a Custom
event, maps the content to something else.
Trait Implementations
sourceimpl<TConnectionUpgrade: Clone, TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade: Clone, TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
sourcefn clone(
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
fn clone(
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
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 moresourceimpl<TConnectionUpgrade: Debug, TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade: Debug, TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
sourceimpl<TConnectionUpgrade: PartialEq, TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade: PartialEq, TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
sourcefn eq(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
fn eq(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
impl<TConnectionUpgrade: Copy, TOutboundOpenInfo: Copy, TCustom: Copy> Copy for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade: Eq, TOutboundOpenInfo: Eq, TCustom: Eq> Eq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> StructuralEq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> StructuralPartialEq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
Auto Trait Implementations
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> RefUnwindSafe for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>where
TConnectionUpgrade: RefUnwindSafe,
TCustom: RefUnwindSafe,
TOutboundOpenInfo: RefUnwindSafe,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Send for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>where
TConnectionUpgrade: Send,
TCustom: Send,
TOutboundOpenInfo: Send,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Sync for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>where
TConnectionUpgrade: Sync,
TCustom: Sync,
TOutboundOpenInfo: Sync,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Unpin for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>where
TConnectionUpgrade: Unpin,
TCustom: Unpin,
TOutboundOpenInfo: Unpin,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> UnwindSafe for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>where
TConnectionUpgrade: UnwindSafe,
TCustom: UnwindSafe,
TOutboundOpenInfo: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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