pub enum NetworkBehaviourAction<TInEvent, TOutEvent> {
GenerateEvent(TOutEvent),
DialAddress {
address: Multiaddr,
},
DialPeer {
peer_id: PeerId,
},
SendEvent {
peer_id: PeerId,
event: TInEvent,
},
ReportObservedAddr {
address: Multiaddr,
},
}
Generate an event for the outside.
Instructs the swarm to dial the given multiaddress without any expectation of a peer id.
Fields of DialAddress
Instructs the swarm to try reach the given peer.
Fields of DialPeer
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
The peer which to send the message to.
Event to send to the peer.
Reports that a remote observes us as this address.
The swarm will pass this address through the transport's NAT traversal.
Fields of ReportObservedAddr
The address we're being observed as.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)