Trait Discv5ApiClient

Source
pub trait Discv5ApiClient: ClientT {
    // Provided methods
    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 update_node_info<'life0, 'async_trait>(
        &'life0 self,
        socket_addr: String,
        is_tcp: bool,
    ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn routing_table_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RoutingTableInfo, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn add_enr<'life0, 'async_trait>(
        &'life0 self,
        enr: Enr,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_enr<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = Result<Enr, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn delete_enr<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn lookup_enr<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = Result<Enr, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn recursive_find_nodes<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Enr>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn talk_req<'life0, 'async_trait>(
        &'life0 self,
        enr: Enr,
        protocol: Subnetwork,
        request: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn ping<'life0, 'async_trait>(
        &'life0 self,
        enr: Enr,
    ) -> Pin<Box<dyn Future<Output = Result<Pong, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn find_node<'life0, 'async_trait>(
        &'life0 self,
        enr: Enr,
        distances: Vec<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Enr>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Client implementation for the Discv5Api RPC API.

Provided Methods§

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 ENR and Node ID information of the local discv5 node.

Source

fn update_node_info<'life0, 'async_trait>( &'life0 self, socket_addr: String, is_tcp: bool, ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Update the socket address of the local node record.

Source

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

Returns meta information about discv5 routing table.

Source

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

Write an Ethereum Node Record to the routing table.

Source

fn get_enr<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = Result<Enr, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch the latest ENR associated with the given node ID.

Source

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

Delete Node ID from the routing table.

Source

fn lookup_enr<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = Result<Enr, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch the ENR representation associated with the given Node ID.

Source

fn recursive_find_nodes<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Enr>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Look up ENRs closest to the given target

Source

fn talk_req<'life0, 'async_trait>( &'life0 self, enr: Enr, protocol: Subnetwork, request: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Send a TALKREQ request with a payload to a given peer and wait for response.

Source

fn ping<'life0, 'async_trait>( &'life0 self, enr: Enr, ) -> Pin<Box<dyn Future<Output = Result<Pong, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Send a PING message to the designated node and wait for a PONG response.

Source

fn find_node<'life0, 'async_trait>( &'life0 self, enr: Enr, distances: Vec<u64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Enr>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Send a FINDNODE request for nodes that fall within the given set of distances, to the designated peer and wait for a response.

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> Discv5ApiClient for TypeJsonRpseeInteral
where TypeJsonRpseeInteral: ClientT,