use crate::core::stratum;
use crate::rest::*;
use crate::stratum::Stratum;
#[easy_jsonrpc_mw::rpc]
pub trait StratumRpc: Sync + Send {
fn get_ip_list(
&self,
banned: Option<bool>,
) -> Result<Vec<stratum::connections::StratumIpPrintable>, Error>;
fn clean_ip(&self, ip: String) -> Result<(), Error>;
fn get_ip_info(&self, ip: String) -> Result<stratum::connections::StratumIpPrintable, Error>;
}
impl StratumRpc for Stratum {
fn get_ip_list(
&self,
banned: Option<bool>,
) -> Result<Vec<stratum::connections::StratumIpPrintable>, Error> {
Stratum::get_ip_list(self, banned)
}
fn clean_ip(&self, ip: String) -> Result<(), Error> {
Stratum::clean_ip(self, &ip)
}
fn get_ip_info(&self, ip: String) -> Result<stratum::connections::StratumIpPrintable, Error> {
Stratum::get_ip_info(self, &ip)
}
}