pub struct PeerManagerConnector { /* private fields */ }
Expand description

The PeerManagerConnector will be used to make requests to the PeerManager.

The connector includes functions to add a new peer reference, update a peer and list the existing peers.

Implementations

Requests that a peer is added to the PeerManager. If a peer already exists, the peer’s reference count will be incremented

Returns a PeerRef that, when dropped, will automatically send a removal request to the PeerManager.

Arguments
  • peer_id - The unique PeerAuthorizationToken for the peer.
  • endpoints - The list of endpoints associated with the peer. The list should be in order of preference, with the first endpoint being the first attempted.
  • required_local_auth - The local authorization that must be used to identify the local node during authorization.

Requests that a peer is added to the PeerManager. This function should be used when the peer ID is unknown.

Returns Ok(EndpointPeerRef) if the unidentified peer was added

Arguments
  • endpoint - The endpoint associated with the peer.
  • local_authorization - The required PeerAuthorizationToken that will be used to identify
  • the local node.

Requests the list of currently connected peers.

Returns the list of peer IDs.

Requests the list of unreferenced peers.

Unreferenced peers are those peers that have successfully connected from a remote node, but have not yet been referenced by a circuit. These peers are available to be promoted to fully refrerenced peers.

Requests the map of currently connected peers to connection IDs

Returns a map of peer IDs to connection IDs

👎 Deprecated since 0.5.1:

please use subscribe_sender instead

Subscribes to PeerManager notifications.

Returns a PeerNotificationIter that can be used to receive notifications about connected and disconnected peers

Subscribe to notifications for peer events.

PeerManagerNotification instances will be transformed via type T’s implementation of From<PeerManagerNotification> and passed to the given sender.

Returns

The subscriber ID that can be used for unsubscribing the given sender.

Errors

Return a PeerManagerError if the subscriber cannot be registered via the PeerManagerConnector instance.

Unsubscribe from PeerManagerNotification.

Errors

Returns a PeerManagerError if the PeerManager has stopped running.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Retrieves the connection ID for a given peer ID, if found. Read more

Retrieves the peer ID for a given connection ID, if found. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more