[][src]Enum libp2p_core::nodes::handled_node::NodeHandlerEvent

pub enum NodeHandlerEvent<TOutboundOpenInfo, TCustom> {
    OutboundSubstreamRequest(TOutboundOpenInfo),
    Custom(TCustom),
}

Event produced by a handler.

Variants

OutboundSubstreamRequest(TOutboundOpenInfo)

Require a new outbound substream to be opened with the remote.

Custom(TCustom)

Other event.

Methods

impl<TOutboundOpenInfo, TCustom> NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

Event produced by a handler.

pub fn map_outbound_open_info<F, I>(
    self,
    map: F
) -> NodeHandlerEvent<I, TCustom> where
    F: FnOnce(TOutboundOpenInfo) -> I, 
[src]

If this is OutboundSubstreamRequest, maps the content to something else.

pub fn map_custom<F, I>(self, map: F) -> NodeHandlerEvent<TOutboundOpenInfo, I> where
    F: FnOnce(TCustom) -> I, 
[src]

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

Trait Implementations

impl<TOutboundOpenInfo: Clone, TCustom: Clone> Clone for NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

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

Performs copy-assignment from source. Read more

impl<TOutboundOpenInfo: Eq, TCustom: Eq> Eq for NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

impl<TOutboundOpenInfo: Copy, TCustom: Copy> Copy for NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

impl<TOutboundOpenInfo: PartialEq, TCustom: PartialEq> PartialEq<NodeHandlerEvent<TOutboundOpenInfo, TCustom>> for NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

impl<TOutboundOpenInfo: Debug, TCustom: Debug> Debug for NodeHandlerEvent<TOutboundOpenInfo, TCustom>[src]

Auto Trait Implementations

impl<TOutboundOpenInfo, TCustom> Send for NodeHandlerEvent<TOutboundOpenInfo, TCustom> where
    TCustom: Send,
    TOutboundOpenInfo: Send

impl<TOutboundOpenInfo, TCustom> Sync for NodeHandlerEvent<TOutboundOpenInfo, TCustom> where
    TCustom: Sync,
    TOutboundOpenInfo: Sync

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T