pub mod error;
pub mod helpers;
use crate::helpers::Receiver;
use jsonrpc_derive::rpc;
use futures::{future::BoxFuture, compat::Compat};
use self::error::Result as SystemResult;
pub use self::helpers::{Properties, SystemInfo, Health, PeerInfo, NodeRole};
pub use self::gen_client::Client as SystemClient;
#[rpc]
pub trait SystemApi<Hash, Number> {
#[rpc(name = "system_name")]
fn system_name(&self) -> SystemResult<String>;
#[rpc(name = "system_version")]
fn system_version(&self) -> SystemResult<String>;
#[rpc(name = "system_chain")]
fn system_chain(&self) -> SystemResult<String>;
#[rpc(name = "system_properties")]
fn system_properties(&self) -> SystemResult<Properties>;
#[rpc(name = "system_health", returns = "Health")]
fn system_health(&self) -> Receiver<Health>;
#[rpc(name = "system_peers", returns = "Vec<PeerInfo<Hash, Number>>")]
fn system_peers(&self) -> Receiver<Vec<PeerInfo<Hash, Number>>>;
#[rpc(name = "system_networkState", returns = "jsonrpc_core::Value")]
fn system_network_state(&self) -> Receiver<jsonrpc_core::Value>;
#[rpc(name = "system_addReservedPeer", returns = "()")]
fn system_add_reserved_peer(&self, peer: String)
-> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
#[rpc(name = "system_removeReservedPeer", returns = "()")]
fn system_remove_reserved_peer(&self, peer_id: String)
-> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
#[rpc(name = "system_nodeRoles", returns = "Vec<NodeRole>")]
fn system_node_roles(&self) -> Receiver<Vec<NodeRole>>;
}