pub trait NetApi:
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§
Sourcefn peer_count(&self) -> Result<u32>
fn peer_count(&self) -> Result<u32>
Returns number of peers connected to node.
Sourcefn is_listening(&self) -> Result<bool>
fn is_listening(&self) -> Result<bool>
Returns true if client is actively listening for network connections. Otherwise false.
Provided Methods§
Sourcefn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>
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.