Trait AdminApiClient

Source
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§

Source

fn add_peer( &self, record: NodeRecord, ) -> impl Future<Output = Result<bool, Error>> + Send

Adds the given node record to the peerset.

Source

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.

Source

fn add_trusted_peer( &self, record: AnyNode, ) -> impl Future<Output = Result<bool, Error>> + Send

Adds the given node record to the trusted peerset.

Source

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.

Source

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

Source

fn node_info(&self) -> impl Future<Output = Result<NodeInfo, Error>> + Send

Returns the ENR of the node.

Source

fn subscribe_peer_events( &self, ) -> impl Future<Output = Result<Subscription<String>, Error>> + Send

Creates an RPC subscription which serves events received from the network.

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.

Implementors§

Source§

impl<TypeJsonRpseeInternal> AdminApiClient for TypeJsonRpseeInternal
where TypeJsonRpseeInternal: SubscriptionClientT,