[][src]Enum libp2p_core::swarm::NetworkBehaviourAction

pub enum NetworkBehaviourAction<TInEvent, TOutEvent> {
    GenerateEvent(TOutEvent),
    DialAddress {
        address: Multiaddr,
    },
    DialPeer {
        peer_id: PeerId,
    },
    SendEvent {
        peer_id: PeerId,
        event: TInEvent,
    },
    ReportObservedAddr {
        address: Multiaddr,
    },
}

Action to perform.

Variants

GenerateEvent(TOutEvent)

Generate an event for the outside.

DialAddress

Instructs the swarm to dial the given multiaddress without any expectation of a peer id.

Fields of DialAddress

address: Multiaddr

The address to dial.

DialPeer

Instructs the swarm to try reach the given peer.

Fields of DialPeer

peer_id: PeerId

The peer to try reach.

SendEvent

If we're connected to the given peer, sends a message to the protocol handler.

If we're not connected to this peer, does nothing. If necessary, the implementation of NetworkBehaviour is supposed to track which peers we are connected to.

Fields of SendEvent

peer_id: PeerId

The peer which to send the message to.

event: TInEvent

Event to send to the peer.

ReportObservedAddr

Reports that a remote observes us as this address.

The swarm will pass this address through the transport's NAT traversal.

Fields of ReportObservedAddr

address: Multiaddr

The address we're being observed as.

Trait Implementations

impl<TInEvent: Clone, TOutEvent: Clone> Clone for NetworkBehaviourAction<TInEvent, TOutEvent>[src]

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

Performs copy-assignment from source. Read more

impl<TInEvent: Debug, TOutEvent: Debug> Debug for NetworkBehaviourAction<TInEvent, TOutEvent>[src]

Auto Trait Implementations

impl<TInEvent, TOutEvent> Send for NetworkBehaviourAction<TInEvent, TOutEvent> where
    TInEvent: Send,
    TOutEvent: Send

impl<TInEvent, TOutEvent> Sync for NetworkBehaviourAction<TInEvent, TOutEvent> where
    TInEvent: Sync,
    TOutEvent: Sync

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T