[][src]Struct stratum_server::Connection

pub struct Connection {
    pub sender: Arc<Mutex<UnboundedSender<String>>>,
    pub authorized: Arc<Mutex<bool>>,
    pub subscribed: Arc<Mutex<bool>>,
    pub session_start: SystemTime,
    pub connection_state: Mutex<ConnectionState>,
    pub difficulty: Arc<Mutex<f64>>,
    pub stats: Arc<Mutex<MinerStats>>,
    pub needs_ban: Arc<Mutex<bool>>,
    pub next_difficulty: Arc<Mutex<Option<f64>>>,
    pub id: Uuid,
    pub subscriber_id: Arc<Mutex<String>>,
    pub miner_info: Arc<RwLock<MinerInfo>>,
    pub job_stats: Arc<Mutex<JobStats>>,
    pub options: Arc<MinerOptions>,
    pub var_diff: bool,
    pub last_message_id: Arc<Mutex<ID>>,
    pub worker_info: Arc<Mutex<WorkerInfo>>,
}

Fields

sender: Arc<Mutex<UnboundedSender<String>>>authorized: Arc<Mutex<bool>>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: boollast_message_id: Arc<Mutex<ID>>worker_info: Arc<Mutex<WorkerInfo>>

Implementations

impl Connection[src]

pub fn new(
    addr: SocketAddr,
    sender: UnboundedSender<String>,
    initial_difficulty: f64,
    var_diff_config: VarDiffConfig
) -> Self
[src]

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 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_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 valid_share<'_>(&'_ self)[src]

pub async fn update_difficulty<'_>(&'_ self) -> Option<f64>[src]

pub async fn invalid_share<'_>(&'_ self)[src]

pub async fn consider_ban<'_>(&'_ self)[src]

Trait Implementations

impl Debug for Connection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,