pub trait AdminApiClient: SubscriptionClientT {
// Provided methods
fn add_peer(
&self,
record: NodeRecord,
) -> impl Future<Output = Result<bool, Error>> + Send { ... }
fn remove_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send { ... }
fn add_trusted_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send { ... }
fn remove_trusted_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send { ... }
fn peers(&self) -> impl Future<Output = Result<Vec<PeerInfo>, Error>> + Send { ... }
fn node_info(&self) -> impl Future<Output = Result<NodeInfo, Error>> + Send { ... }
fn subscribe_peer_events(
&self,
) -> impl Future<Output = Result<Subscription<String>, Error>> + Send { ... }
}
Expand description
Client implementation for the AdminApi
RPC API.
Provided Methods§
Sourcefn add_peer(
&self,
record: NodeRecord,
) -> impl Future<Output = Result<bool, Error>> + Send
fn add_peer( &self, record: NodeRecord, ) -> impl Future<Output = Result<bool, Error>> + Send
Adds the given node record to the peerset.
Sourcefn remove_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send
fn remove_peer( &self, record: AnyNode, ) -> impl Future<Output = Result<bool, Error>> + Send
Disconnects from a remote node if the connection exists.
Returns true if the peer was successfully removed.
Sourcefn add_trusted_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send
fn add_trusted_peer( &self, record: AnyNode, ) -> impl Future<Output = Result<bool, Error>> + Send
Adds the given node record to the trusted peerset.
Sourcefn remove_trusted_peer(
&self,
record: AnyNode,
) -> impl Future<Output = Result<bool, Error>> + Send
fn remove_trusted_peer( &self, record: AnyNode, ) -> impl Future<Output = Result<bool, Error>> + Send
Removes a remote node from the trusted peer set, but it does not disconnect it automatically.
Returns true if the peer was successfully removed.
Sourcefn peers(&self) -> impl Future<Output = Result<Vec<PeerInfo>, Error>> + Send
fn peers(&self) -> impl Future<Output = Result<Vec<PeerInfo>, Error>> + Send
The peers administrative property can be queried for all the information known about the connected remote nodes at the networking granularity. These include general information about the nodes themselves as participants of the devp2p P2P overlay protocol, as well as specialized information added by each of the running application protocols
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.