[−][src]Struct stratum_server::Connection
Fields
id: Uuid
write_half: Arc<Mutex<WriteHalf<TcpStream>>>
read_half: Arc<Mutex<BufReader<ReadHalf<TcpStream>>>>
session_start: SystemTime
connection_state: Mutex<ConnectionState>
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: bool
ban_stats: Arc<Mutex<BanStats>>
classic: Arc<Mutex<bool>>
last_message_id: Arc<Mutex<ID>>
worker_info: Arc<Mutex<WorkerInfo>>
Implementations
impl Connection
[src]
pub fn new(
addr: SocketAddr,
rh: BufReader<ReadHalf<TcpStream>>,
wh: WriteHalf<TcpStream>,
var_diff: bool,
initial_difficulty: f64
) -> Self
[src]
addr: SocketAddr,
rh: BufReader<ReadHalf<TcpStream>>,
wh: WriteHalf<TcpStream>,
var_diff: bool,
initial_difficulty: f64
) -> Self
pub async fn info<'_>(&'_ self) -> MinerInfo
[src]
pub async fn is_disconnected<'_>(&'_ self) -> bool
[src]
pub async fn next_message<'_>(&'_ self) -> Result<(String, Map<String, Value>)>
[src]
pub async fn send<T: Serialize, '_>(&'_ self, message: T) -> Result<()>
[src]
pub async fn shutdown<'_>(&'_ self) -> Result<()>
[src]
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]
pub async fn ip<'_>(&'_ self) -> IpAddr
[src]
pub fn id(&self) -> Uuid
[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<String>
[src]
pub async fn set_sid<'_, '_>(&'_ self, sid: &'_ str)
[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]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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> 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.
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>,