op_alloy::rpc_jsonrpsee::traits

Trait OpP2PApiServer

Source
pub trait OpP2PApiServer:
    Sized
    + Send
    + Sync
    + 'static {
Show 17 methods // Required methods fn opp2p_self<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerInfo, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerDump, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_peer_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerStats, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_discovery_table<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_block_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_list_blocked_peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_block_addr<'life0, 'async_trait>( &'life0 self, ip: IpAddr, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_unblock_addr<'life0, 'async_trait>( &'life0 self, ip: IpAddr, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_list_blocked_addrs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<IpAddr>, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_block_subnet<'life0, 'async_trait>( &'life0 self, subnet: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_unblock_subnet<'life0, 'async_trait>( &'life0 self, subnet: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_list_blocked_subnets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_protect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_unprotect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_connect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn opp2p_disconnect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; // Provided method fn into_rpc(self) -> RpcModule<Self> { ... }
}
Available on crate feature rpc-jsonrpsee only.
Expand description

Server trait implementation for the OpP2PApi RPC API.

Required Methods§

Source

fn opp2p_self<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerInfo, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns information of node

Source

fn opp2p_peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerDump, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_peer_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PeerStats, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_discovery_table<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_block_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_list_blocked_peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_block_addr<'life0, 'async_trait>( &'life0 self, ip: IpAddr, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_unblock_addr<'life0, 'async_trait>( &'life0 self, ip: IpAddr, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_list_blocked_addrs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<IpAddr>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_block_subnet<'life0, 'async_trait>( &'life0 self, subnet: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

todo: should be IPNet?

Source

fn opp2p_unblock_subnet<'life0, 'async_trait>( &'life0 self, subnet: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

todo: should be IPNet?

Source

fn opp2p_list_blocked_subnets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

todo: should be IPNet?

Source

fn opp2p_protect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_unprotect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_connect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn opp2p_disconnect_peer<'life0, 'async_trait>( &'life0 self, peer: String, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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§