missing net_ methods

This commit is contained in:
debris 2016-01-27 19:03:12 +01:00
parent b13d68c7e9
commit f8568e10b7

View File

@ -10,11 +10,16 @@ pub trait Net: Sized + Send + Sync + 'static {
/// Returns number of peers connected to node.
fn peer_count(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Returns true if client is actively listening for network connections.
/// Otherwise false.
fn is_listening(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Should be used to convert object to io delegate.
fn to_delegate(self) -> IoDelegate<Self> {
let mut delegate = IoDelegate::new(Arc::new(self));
delegate.add_method("net_version", Net::version);
delegate.add_method("net_peerCount", Net::peer_count);
delegate.add_method("net_listening", Net::is_listening);
delegate
}
}