[−][src]Enum libp2p_swarm::NetworkBehaviourAction
An action that a NetworkBehaviour can trigger in the [Swarm]
in whose context it is executing.
Variants
GenerateEvent(TOutEvent)Instructs the Swarm to return an event when it is being polled.
DialAddressInstructs the swarm to dial the given multiaddress, with no knowledge of the PeerId that
may be reached.
Fields of DialAddress
DialPeerInstructs the swarm to dial a known PeerId.
The addresses_of_peer method is called to determine which addresses to attempt to reach.
If we were already trying to dial this node, the addresses that are not yet in the queue of addresses to try are added back to this queue.
On success, NetworkBehaviour::inject_connected is invoked.
On failure, NetworkBehaviour::inject_dial_failure is invoked.
Fields of DialPeer
peer_id: PeerIdThe peer to try reach.
SendEventInstructs the Swarm to send a message to the handler dedicated to the connection with the peer.
If the Swarm is connected to the peer, the message is delivered to the remote's
protocol handler. If there is no connection to the peer, the message is ignored.
To ensure delivery, the NetworkBehaviour must keep track of connected peers.
Note that even if the peer is currently connected, connections can get closed at any time and thus the message may not reach its destination.
Fields of SendEvent
ReportObservedAddrInforms the Swarm about a multi-address observed by a remote for
the local node.
It is advisable to issue ReportObservedAddr actions at a fixed frequency
per node. This way address information will be more accurate over time
and individual outliers carry less weight.
Fields of ReportObservedAddr
Trait Implementations
impl<TInEvent: Clone, TOutEvent: Clone> Clone for NetworkBehaviourAction<TInEvent, TOutEvent>[src]
fn clone(&self) -> 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> Sync for NetworkBehaviourAction<TInEvent, TOutEvent> where
TInEvent: Sync,
TOutEvent: Sync,
TInEvent: Sync,
TOutEvent: Sync,
impl<TInEvent, TOutEvent> Send for NetworkBehaviourAction<TInEvent, TOutEvent> where
TInEvent: Send,
TOutEvent: Send,
TInEvent: Send,
TOutEvent: Send,
impl<TInEvent, TOutEvent> Unpin for NetworkBehaviourAction<TInEvent, TOutEvent> where
TInEvent: Unpin,
TOutEvent: Unpin,
TInEvent: Unpin,
TOutEvent: Unpin,
impl<TInEvent, TOutEvent> RefUnwindSafe for NetworkBehaviourAction<TInEvent, TOutEvent> where
TInEvent: RefUnwindSafe,
TOutEvent: RefUnwindSafe,
TInEvent: RefUnwindSafe,
TOutEvent: RefUnwindSafe,
impl<TInEvent, TOutEvent> UnwindSafe for NetworkBehaviourAction<TInEvent, TOutEvent> where
TInEvent: UnwindSafe,
TOutEvent: UnwindSafe,
TInEvent: UnwindSafe,
TOutEvent: UnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &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, 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self