[][src]Enum susyp2p::core::protocols_handler::ProtocolsHandlerEvent

pub enum ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> {
    OutboundSubstreamRequest {
        protocol: SubstreamProtocol<TConnectionUpgrade>,
        info: TOutboundOpenInfo,
    },
    Custom(TCustom),
}

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]

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]

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]

If this is a Custom event, maps the content to something else.

Trait Implementations

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Clone for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Clone,
    TCustom: Clone,
    TOutboundOpenInfo: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Eq for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Eq,
    TCustom: Eq,
    TOutboundOpenInfo: Eq
[src]

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Copy for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Copy,
    TCustom: Copy,
    TOutboundOpenInfo: Copy
[src]

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Debug for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Debug,
    TCustom: Debug,
    TOutboundOpenInfo: Debug
[src]

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]

Auto Trait Implementations

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Send for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Send,
    TCustom: Send,
    TOutboundOpenInfo: Send

impl<TConnectionUpgrade, TOutboundOpenInfo, TCustom> Sync for ProtocolsHandlerEvent<TConnectionUpgrade, TOutboundOpenInfo, TCustom> where
    TConnectionUpgrade: Sync,
    TCustom: Sync,
    TOutboundOpenInfo: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.