Enum libp2p::core::connection::ConnectionHandlerEvent
source · [−]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, TCustom> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Clone,
TCustom: Clone,
impl<TOutboundOpenInfo, TCustom> Clone for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Clone,
TCustom: Clone,
sourcepub fn clone(&self) -> ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
pub 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, TCustom> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Debug,
TCustom: Debug,
impl<TOutboundOpenInfo, TCustom> Debug for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Debug,
TCustom: Debug,
sourceimpl<TOutboundOpenInfo, TCustom> PartialEq<ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>> for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
TCustom: PartialEq<TCustom>,
impl<TOutboundOpenInfo, TCustom> PartialEq<ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>> for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
TCustom: PartialEq<TCustom>,
sourcepub fn eq(
&self,
other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
) -> bool
pub 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
sourcepub fn ne(
&self,
other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
) -> bool
pub fn ne(
&self,
other: &ConnectionHandlerEvent<TOutboundOpenInfo, TCustom>
) -> bool
This method tests for !=
.
impl<TOutboundOpenInfo, TCustom> Copy for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Copy,
TCustom: Copy,
impl<TOutboundOpenInfo, TCustom> Eq for ConnectionHandlerEvent<TOutboundOpenInfo, TCustom> where
TOutboundOpenInfo: Eq,
TCustom: Eq,
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