missing net_ methods
This commit is contained in:
parent
b13d68c7e9
commit
f8568e10b7
@ -10,11 +10,16 @@ pub trait Net: Sized + Send + Sync + 'static {
|
|||||||
/// Returns number of peers connected to node.
|
/// Returns number of peers connected to node.
|
||||||
fn peer_count(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
|
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.
|
/// Should be used to convert object to io delegate.
|
||||||
fn to_delegate(self) -> IoDelegate<Self> {
|
fn to_delegate(self) -> IoDelegate<Self> {
|
||||||
let mut delegate = IoDelegate::new(Arc::new(self));
|
let mut delegate = IoDelegate::new(Arc::new(self));
|
||||||
delegate.add_method("net_version", Net::version);
|
delegate.add_method("net_version", Net::version);
|
||||||
delegate.add_method("net_peerCount", Net::peer_count);
|
delegate.add_method("net_peerCount", Net::peer_count);
|
||||||
|
delegate.add_method("net_listening", Net::is_listening);
|
||||||
delegate
|
delegate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user