Struct stratum_server::Miner
source · [−]pub struct Miner {
pub id: Uuid,
pub sid: Buffer,
pub client: Option<String>,
pub name: Option<String>,
pub difficulty: Arc<Mutex<u64>>,
pub previous_difficulty: Arc<Mutex<u64>>,
pub next_difficulty: Arc<Mutex<Option<u64>>>,
pub stats: Arc<Mutex<MinerStats>>,
pub job_stats: Arc<Mutex<JobStats>>,
pub options: Arc<MinerOptions>,
pub needs_ban: Arc<Mutex<bool>>,
}
Fields
id: Uuid
sid: Buffer
client: Option<String>
name: Option<String>
difficulty: Arc<Mutex<u64>>
previous_difficulty: Arc<Mutex<u64>>
next_difficulty: Arc<Mutex<Option<u64>>>
stats: Arc<Mutex<MinerStats>>
job_stats: Arc<Mutex<JobStats>>
options: Arc<MinerOptions>
needs_ban: Arc<Mutex<bool>>
Implementations
sourceimpl Miner
impl Miner
pub fn new(
id: Uuid,
client: Option<String>,
name: Option<String>,
sid: Buffer,
options: Arc<MinerOptions>,
difficulty: u64
) -> Self
pub async fn ban(&self)
pub async fn consider_ban(&self)
pub async fn current_difficulty(&self) -> u64
pub async fn previous_difficulty(&self) -> u64
pub async fn update_difficulty(&self) -> Option<u64>
pub async fn set_difficulty(&self, difficulty: u64)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Miner
impl Send for Miner
impl Sync for Miner
impl Unpin for Miner
impl !UnwindSafe for Miner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more