[−][src]Enum libp2p::core::protocols_handler::ProtocolsHandlerEvent
Event produced by a handler.
Variants
OutboundSubstreamRequest
Request a new outbound substream to be opened with the remote.
Fields of OutboundSubstreamRequest
protocol: SubstreamProtocol<TConnectionUpgrade>
The protocol(s) to apply on the substream.
info: TOutboundOpenInfo
User-defined information, passed back when the substream is open.
Custom(TCustom)
Other event.
Methods
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
[src]
Event produced by a handler.
pub fn map_outbound_open_info<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom> where
F: FnOnce(TOutboundOpenInfo) -> I,
[src]
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.
pub fn map_protocol<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom> where
F: FnOnce(TConnectionUpgrade) -> I,
[src]
self,
map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom> where
F: FnOnce(TConnectionUpgrade) -> I,
If this is an OutboundSubstreamRequest
, maps the protocol (TConnectionUpgrade
)
to something else.
pub fn map_custom<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, I> where
F: FnOnce(TCustom) -> I,
[src]
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
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Eq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Eq,
TCustom: Eq,
TOutboundOpenInfo: Eq,
[src]
TConnectionUpgrade: Eq,
TCustom: Eq,
TOutboundOpenInfo: Eq,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Clone for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Clone,
TCustom: Clone,
TOutboundOpenInfo: Clone,
[src]
TConnectionUpgrade: Clone,
TCustom: Clone,
TOutboundOpenInfo: Clone,
fn clone(
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
[src]
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: PartialEq<TConnectionUpgrade>,
TCustom: PartialEq<TCustom>,
TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
[src]
TConnectionUpgrade: PartialEq<TConnectionUpgrade>,
TCustom: PartialEq<TCustom>,
TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
fn eq(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
[src]
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
fn ne(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
[src]
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom>
) -> bool
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Copy for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Copy,
TCustom: Copy,
TOutboundOpenInfo: Copy,
[src]
TConnectionUpgrade: Copy,
TCustom: Copy,
TOutboundOpenInfo: Copy,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Debug for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Debug,
TCustom: Debug,
TOutboundOpenInfo: Debug,
[src]
TConnectionUpgrade: Debug,
TCustom: Debug,
TOutboundOpenInfo: Debug,
Auto Trait Implementations
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Send for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Send,
TCustom: Send,
TOutboundOpenInfo: Send,
TConnectionUpgrade: Send,
TCustom: Send,
TOutboundOpenInfo: Send,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Sync for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
TConnectionUpgrade: Sync,
TCustom: Sync,
TOutboundOpenInfo: Sync,
TConnectionUpgrade: Sync,
TCustom: Sync,
TOutboundOpenInfo: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self