[−][src]Struct stratum_server::Connection
Fields
id: IDwrite_half: Arc<Mutex<WriteHalf<TcpStream>>>read_half: Arc<Mutex<BufReader<ReadHalf<TcpStream>>>>data_provider: Arc<SM::DataProvider>block_validator: Arc<SM::BlockValidator>auth_manager: Arc<SM::AuthManager>session_start: SystemTimestate: Mutex<State>subscribed: Arc<Mutex<bool>>subscriber_id: Arc<Mutex<String>>miner_info: Arc<RwLock<MinerInfo>>difficulty: Arc<Mutex<f64>>submissions: Arc<Mutex<u64>>last_retarget: Arc<Mutex<SystemTime>>next_difficulty: Arc<Mutex<f64>>job_stats: Arc<Mutex<JobStats>>options: Arc<MinerOptions>stats: Arc<Mutex<MinerStats>>needs_ban: Arc<Mutex<bool>>var_diff: boolban_stats: Arc<Mutex<BanStats>>classic: Arc<Mutex<bool>>last_message_id: Arc<Mutex<ID>>Methods
impl<SM> Connection<SM> where
SM: StratumManager, [src]
SM: StratumManager,
pub fn new(
addr: SocketAddr,
rh: BufReader<ReadHalf<TcpStream>>,
wh: WriteHalf<TcpStream>,
data_provider: Arc<SM::DataProvider>,
auth_manager: Arc<SM::AuthManager>,
block_validator: Arc<SM::BlockValidator>,
var_diff: bool,
initial_difficulty: f64
) -> Self[src]
addr: SocketAddr,
rh: BufReader<ReadHalf<TcpStream>>,
wh: WriteHalf<TcpStream>,
data_provider: Arc<SM::DataProvider>,
auth_manager: Arc<SM::AuthManager>,
block_validator: Arc<SM::BlockValidator>,
var_diff: bool,
initial_difficulty: f64
) -> Self
pub async fn start<'_>(&'_ self) -> Result<()>[src]
pub async fn handle_requests<'_>(
&'_ self,
req: Request<SM::PoolParams, SM::StratumParams>
) -> Result<()>[src]
&'_ self,
req: Request<SM::PoolParams, SM::StratumParams>
) -> Result<()>
pub async fn handle_responses<'_>(
&'_ self,
_res: Response<SM::PoolParams>
) -> Result<()>[src]
&'_ self,
_res: Response<SM::PoolParams>
) -> Result<()>
pub async fn next_message<'_>(
&'_ self
) -> Result<StratumPacket<SM::PoolParams, SM::StratumParams>>[src]
&'_ self
) -> Result<StratumPacket<SM::PoolParams, SM::StratumParams>>
pub async fn shutdown<'_>(&'_ self) -> Result<()>[src]
pub async fn handle_authorize<'_, '_>(
&'_ self,
auth: &'_ <SM::PoolParams as PoolParams>::Authorize,
classic: bool
) -> Result<()>[src]
&'_ self,
auth: &'_ <SM::PoolParams as PoolParams>::Authorize,
classic: bool
) -> Result<()>
pub async fn send_initial_work<'_>(&'_ self) -> Result<()>[src]
pub async fn send_work<'_>(&'_ self) -> Result<()>[src]
pub async fn handle_submit<'_, '_>(
&'_ self,
share: &'_ <SM::StratumParams as StratumParams>::Submit
) -> Result<()>[src]
&'_ self,
share: &'_ <SM::StratumParams as StratumParams>::Submit
) -> Result<()>
pub async fn handle_subscribe<'_, '_>(
&'_ self,
subscribe: &'_ <SM::PoolParams as PoolParams>::Subscribe
) -> Result<()>[src]
&'_ self,
subscribe: &'_ <SM::PoolParams as PoolParams>::Subscribe
) -> Result<()>
pub async fn handle_unknown<'_, '_>(&'_ self, _msg: &'_ Value) -> Result<()>[src]
pub async fn disconnect<'_>(&'_ self)[src]
pub async fn ban<'_>(&'_ self)[src]
pub async fn needs_ban<'_>(&'_ self) -> bool[src]
pub async fn get_stats<'_>(&'_ self) -> MinerStats[src]
Trait Implementations
impl<SM: Debug + StratumManager> Debug for Connection<SM> where
SM::DataProvider: Debug,
SM::BlockValidator: Debug,
SM::AuthManager: Debug, [src]
SM::DataProvider: Debug,
SM::BlockValidator: Debug,
SM::AuthManager: Debug,
Auto Trait Implementations
impl<SM> !RefUnwindSafe for Connection<SM>
impl<SM> Send for Connection<SM> where
<SM as StratumManager>::AuthManager: Send + Sync,
<SM as StratumManager>::BlockValidator: Send + Sync,
<SM as StratumManager>::DataProvider: Send + Sync,
<SM as StratumManager>::AuthManager: Send + Sync,
<SM as StratumManager>::BlockValidator: Send + Sync,
<SM as StratumManager>::DataProvider: Send + Sync,
impl<SM> Sync for Connection<SM> where
<SM as StratumManager>::AuthManager: Send + Sync,
<SM as StratumManager>::BlockValidator: Send + Sync,
<SM as StratumManager>::DataProvider: Send + Sync,
<SM as StratumManager>::AuthManager: Send + Sync,
<SM as StratumManager>::BlockValidator: Send + Sync,
<SM as StratumManager>::DataProvider: Send + Sync,
impl<SM> Unpin for Connection<SM>
impl<SM> !UnwindSafe for Connection<SM>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,