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
sourceimpl<TOutboundOpenInfo, TCustom> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
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
sourceimpl<TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Clone, TCustom: Clone> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
sourcefn clone(&self) -> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
fn clone(&self) -> ConnectionHandlerEvent<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 more
sourceimpl<TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Debug, TCustom: Debug> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
sourceimpl<TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq<ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>> for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq<ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>> for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
sourcefn eq(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
fn eq(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
fn ne(&self, other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>) -> bool
This method tests for !=
.
impl<TOutboundOpenInfo: Copy, TCustom: Copy> Copy for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo: Eq, TCustom: Eq> Eq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> StructuralEq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
impl<TOutboundOpenInfo, TCustom> StructuralPartialEq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
Auto Trait Implementations
impl<TOutboundOpenInfo, TCustom> RefUnwindSafe for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TCustom: RefUnwindSafe,
TOutboundOpenInfo: RefUnwindSafe,
impl<TOutboundOpenInfo, TCustom> Send for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TCustom: Send,
TOutboundOpenInfo: Send,
impl<TOutboundOpenInfo, TCustom> Sync for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TCustom: Sync,
TOutboundOpenInfo: Sync,
impl<TOutboundOpenInfo, TCustom> Unpin for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TCustom: Unpin,
TOutboundOpenInfo: Unpin,
impl<TOutboundOpenInfo, TCustom> UnwindSafe for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TCustom: UnwindSafe,
TOutboundOpenInfo: 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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more