Struct stratum_server::Connection [−][src]
Fields
sender: Arc<Mutex<UnboundedSender<String>>>upstream_sender: Arc<Mutex<UnboundedSender<String>>>upstream_receiver: Arc<Mutex<UnboundedReceiver<Map<String, Value>>>>subscribed: Arc<Mutex<bool>>session_start: SystemTimeconnection_state: Mutex<ConnectionState>difficulty: Arc<Mutex<f64>>stats: Arc<Mutex<MinerStats>>needs_ban: Arc<Mutex<bool>>next_difficulty: Arc<Mutex<Option<f64>>>id: Uuidsubscriber_id: Arc<Mutex<String>>miner_info: Arc<RwLock<MinerInfo>>job_stats: Arc<Mutex<JobStats>>options: Arc<MinerOptions>var_diff: Arc<Mutex<bool>>last_message_id: Arc<Mutex<ID>>worker_info: Arc<Mutex<WorkerInfo>>state: Arc<Mutex<State>>stop_source: Arc<Mutex<Option<StopSource>>>stop_token: StopTokenImplementations
impl<State: Clone + Send + Sync + 'static> Connection<State>[src]
pub fn new(
addr: SocketAddr,
sender: UnboundedSender<String>,
upstream_sender: UnboundedSender<String>,
upstream_receiver: UnboundedReceiver<Map<String, Value>>,
initial_difficulty: f64,
var_diff_config: VarDiffConfig,
state: State
) -> Self[src]
addr: SocketAddr,
sender: UnboundedSender<String>,
upstream_sender: UnboundedSender<String>,
upstream_receiver: UnboundedReceiver<Map<String, Value>>,
initial_difficulty: f64,
var_diff_config: VarDiffConfig,
state: State
) -> Self
pub async fn info(&self) -> MinerInfo[src]
pub async fn is_disconnected(&self) -> bool[src]
pub async fn send<T: Serialize>(&self, message: T) -> Result<()>[src]
pub async fn upstream_send<T: Serialize>(&self, message: T) -> Result<()>[src]
pub async fn upstream_result(&self) -> Result<bool>[src]
pub async fn shutdown(&self) -> 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]
pub async fn ip(&self) -> IpAddr[src]
pub fn id(&self) -> Uuid[src]
pub async fn set_sid(&self, sid: Option<String>, sid_size: usize) -> String[src]
pub async fn set_var_diff(&self, var_diff: bool)[src]
pub async fn set_worker_name(&self, name: Option<String>)[src]
pub async fn set_account_id(&self, id: i32)[src]
pub async fn get_account_id(&self) -> i32[src]
pub async fn set_client(&self, client: &str)[src]
pub async fn get_client(&self) -> Option<String>[src]
pub async fn set_worker_id(&self, id: Uuid)[src]
pub async fn get_sid(&self) -> Option<Buffer>[src]
pub async fn get_worker(&self) -> WorkerInfo[src]
pub async fn authorized(&self) -> bool[src]
pub async fn authorize(&self)[src]
pub async fn subscribed(&self) -> bool[src]
pub async fn subscribe(&self)[src]
pub async fn set_difficulty(&self, difficulty: f64)[src]
pub async fn get_difficulty(&self) -> f64[src]
pub async fn get_state(&self) -> State[src]
pub async fn set_state(&self, state: State)[src]
pub async fn valid_share(&self)[src]
pub async fn update_difficulty(&self) -> Option<f64>[src]
pub async fn invalid_share(&self)[src]
pub fn get_stop_token(&self) -> StopToken[src]
pub async fn consider_ban(&self)[src]
Trait Implementations
impl<State: Debug> Debug for Connection<State>[src]
Auto Trait Implementations
impl<State> !RefUnwindSafe for Connection<State>
impl<State> Send for Connection<State> where
State: Send,
State: Send,
impl<State> Sync for Connection<State> where
State: Send,
State: Send,
impl<State> Unpin for Connection<State>
impl<State> !UnwindSafe for Connection<State>
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub 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>,