Trait NetApiServer

Source
pub trait NetApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn version(&self) -> Result<String>;
    fn peer_count(&self) -> Result<u32>;
    fn is_listening(&self) -> Result<bool>;

    // Provided method
    fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... }
}
Expand description

Net rpc interface.

Required Methods§

Source

fn version(&self) -> Result<String>

Returns protocol version.

Source

fn peer_count(&self) -> Result<u32>

Returns number of peers connected to node.

Source

fn is_listening(&self) -> Result<bool>

Returns true if client is actively listening for network connections. Otherwise false.

Provided Methods§

Source

fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>

Create an IoDelegate, wiring rpc calls to the trait methods.

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§