Enum libp2p::swarm::ProtocolsHandlerEvent  [−][src]
pub enum ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> {
    OutboundSubstreamRequest {
        protocol: SubstreamProtocol<TConnectionUpgrade, TOutboundOpenInfo>,
    },
    Close(TErr),
    Custom(TCustom),
}Expand description
Event produced by a handler.
Variants
Request a new outbound substream to be opened with the remote.
Show fields
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]
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]
pub fn map_outbound_open_info<F, I>(
    self, 
    map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, I, TCustom, TErr> where
    F: FnOnce(TOutboundOpenInfo) -> I, [src]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]
pub fn map_protocol<F, I>(
    self, 
    map: F
) -> ProtocolsHandlerEvent<I, TOutboundOpenInfo, TCustom, TErr> where
    F: FnOnce(TConnectionUpgrade) -> I, [src]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]
pub fn map_custom<F, I>(
    self, 
    map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, I, TErr> where
    F: FnOnce(TCustom) -> I, [src]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]
pub fn map_close<F, I>(
    self, 
    map: F
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, I> where
    F: FnOnce(TErr) -> I, [src]If this is a Close event, maps the content to something else.
Trait Implementations
pub fn clone(
    &self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>[src]
pub fn clone(
    &self
) -> ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>[src]Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    TErr: PartialEq<TErr>,
    TConnectionUpgrade: PartialEq<TConnectionUpgrade>,
    TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
    TCustom: PartialEq<TCustom>, [src]
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> PartialEq<ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>> for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    TErr: PartialEq<TErr>,
    TConnectionUpgrade: PartialEq<TConnectionUpgrade>,
    TOutboundOpenInfo: PartialEq<TOutboundOpenInfo>,
    TCustom: PartialEq<TCustom>, [src]pub fn eq(
    &self, 
    other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool[src]
pub fn eq(
    &self, 
    other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
pub fn ne(
    &self, 
    other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool[src]
pub fn ne(
    &self, 
    other: &ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr>
) -> bool[src]This method tests for !=.
impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Copy for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    TErr: Copy,
    TConnectionUpgrade: Copy,
    TOutboundOpenInfo: Copy,
    TCustom: Copy, [src]impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Eq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    TErr: Eq,
    TConnectionUpgrade: Eq,
    TOutboundOpenInfo: Eq,
    TCustom: Eq, [src]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, impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Send for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    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, impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> Unpin for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom, TErr> where
    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, Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V