reth_rpc_api::clients

Trait AdminApiClient

Source
pub trait AdminApiClient: SubscriptionClientT {
    // Provided methods
    fn add_peer<'life0, 'async_trait>(
        &'life0 self,
        record: NodeRecord,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn remove_peer<'life0, 'async_trait>(
        &'life0 self,
        record: AnyNode,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn add_trusted_peer<'life0, 'async_trait>(
        &'life0 self,
        record: AnyNode,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn remove_trusted_peer<'life0, 'async_trait>(
        &'life0 self,
        record: AnyNode,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn peers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn node_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn subscribe_peer_events<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Subscription<String>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature client only.
Expand description

Client implementation for the AdminApi RPC API.

Provided Methods§

Source

fn add_peer<'life0, 'async_trait>( &'life0 self, record: NodeRecord, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Adds the given node record to the peerset.

Source

fn remove_peer<'life0, 'async_trait>( &'life0 self, record: AnyNode, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Disconnects from a remote node if the connection exists.

Returns true if the peer was successfully removed.

Source

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, record: AnyNode, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Adds the given node record to the trusted peerset.

Source

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, record: AnyNode, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

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<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

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<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns the ENR of the node.

Source

fn subscribe_peer_events<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Subscription<String>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

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<TypeJsonRpseeInteral> AdminApiClient for TypeJsonRpseeInteral
where TypeJsonRpseeInteral: SubscriptionClientT,