Trait NodeRunnerTrait

Source
pub trait NodeRunnerTrait:
    Send
    + Sync
    + Debug {
    // Required methods
    fn get_status(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync>>> + Send>>;
    fn get_connected_peers(
        &self,
    ) -> Pin<Box<dyn Future<Output = Vec<PeerInfo>> + Send>>;
    fn dial_peer(
        &self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send>>;
    fn disconnect_peer(
        &self,
        peer_id: &str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send>>;
    fn get_network_stats(
        &self,
    ) -> Pin<Box<dyn Future<Output = NetworkStats> + Send>>;
    fn shutdown(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>>;
}
Expand description

Trait for NodeRunner operations that RPC server can call

Required Methods§

Source

fn get_status( &self, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync>>> + Send>>

Source

fn get_connected_peers( &self, ) -> Pin<Box<dyn Future<Output = Vec<PeerInfo>> + Send>>

Source

fn dial_peer( &self, address: String, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send>>

Source

fn disconnect_peer( &self, peer_id: &str, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send>>

Source

fn get_network_stats( &self, ) -> Pin<Box<dyn Future<Output = NetworkStats> + Send>>

Source

fn shutdown( &self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>>

Implementors§