Enum libp2p_swarm::protocols_handler::ProtocolsHandlerEvent [−][src]
Event produced by a handler.
Variants
Request a new outbound substream to be opened with the remote.
Fields of OutboundSubstreamRequest
protocol: SubstreamProtocol<TConnectionUpgrade, TOutboundOpenInfo>
The protocol(s) to apply on the substream.
Close the connection for the given reason.
Other event.
Implementations
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
Event produced by a handler.
pub fn map_outbound_open_info<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom, TErr> where
F: FnOnce(TOutboundOpenInfo) -> I,
[src]
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom, TErr> 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, TErr> where
F: FnOnce(TConnectionUpgrade) -> I,
[src]
self,
map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom, TErr> 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, TErr> where
F: FnOnce(TCustom) -> I,
[src]
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, I, TErr> where
F: FnOnce(TCustom) -> I,
If this is a Custom
event, maps the content to something else.
pub fn map_close<F, I>(
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, I> where
F: FnOnce(TErr) -> I,
[src]
self,
map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, I> where
F: FnOnce(TErr) -> I,
If this is a Close
event, maps the content to something else.
Trait Implementations
impl<TConnectionUpgrade: Clone, TOutboundOpenInfo: Clone, TCustom: Clone, TErr: Clone> Clone for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
fn clone(
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
&self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<TConnectionUpgrade: Copy, TOutboundOpenInfo: Copy, TCustom: Copy, TErr: Copy> Copy for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
impl<TConnectionUpgrade: Debug, TOutboundOpenInfo: Debug, TCustom: Debug, TErr: Debug> Debug for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
impl<TConnectionUpgrade: Eq, TOutboundOpenInfo: Eq, TCustom: Eq, TErr: Eq> Eq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
impl<TConnectionUpgrade: PartialEq, TOutboundOpenInfo: PartialEq, TCustom: PartialEq, TErr: PartialEq> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
fn eq(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool
[src]
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool
fn ne(
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool
[src]
&self,
other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> StructuralEq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> StructuralPartialEq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
[src]
Auto Trait Implementations
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> RefUnwindSafe for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
TConnectionUpgrade: RefUnwindSafe,
TCustom: RefUnwindSafe,
TErr: RefUnwindSafe,
TOutboundOpenInfo: RefUnwindSafe,
TConnectionUpgrade: RefUnwindSafe,
TCustom: RefUnwindSafe,
TErr: RefUnwindSafe,
TOutboundOpenInfo: RefUnwindSafe,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Send for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
TConnectionUpgrade: Send,
TCustom: Send,
TErr: Send,
TOutboundOpenInfo: Send,
TConnectionUpgrade: Send,
TCustom: Send,
TErr: Send,
TOutboundOpenInfo: Send,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Sync for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
TConnectionUpgrade: Sync,
TCustom: Sync,
TErr: Sync,
TOutboundOpenInfo: Sync,
TConnectionUpgrade: Sync,
TCustom: Sync,
TErr: Sync,
TOutboundOpenInfo: Sync,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Unpin for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
TConnectionUpgrade: Unpin,
TCustom: Unpin,
TErr: Unpin,
TOutboundOpenInfo: Unpin,
TConnectionUpgrade: Unpin,
TCustom: Unpin,
TErr: Unpin,
TOutboundOpenInfo: Unpin,
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> UnwindSafe for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
TConnectionUpgrade: UnwindSafe,
TCustom: UnwindSafe,
TErr: UnwindSafe,
TOutboundOpenInfo: UnwindSafe,
TConnectionUpgrade: UnwindSafe,
TCustom: UnwindSafe,
TErr: UnwindSafe,
TOutboundOpenInfo: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,