stratum_apps/utils/
types.rs

1use stratum_core::{codec_sv2::StandardSv2Frame, parsers_sv2::AnyMessage};
2
3pub type TemplateId = u64;
4pub type UpstreamJobId = u32;
5pub type JobId = u32;
6pub type DownstreamId = usize;
7pub type RequestId = u32;
8pub type ChannelId = u32;
9pub type Hashrate = f32;
10pub type SharesPerMinute = f32;
11pub type SharesBatchSize = usize;
12pub type ExtensionType = u16;
13pub type MessageType = u8;
14
15pub type Message = AnyMessage<'static>;
16pub type Sv2Frame = StandardSv2Frame<Message>;
17
18#[derive(Debug, PartialEq, Eq, Hash)]
19pub struct VardiffKey {
20    pub downstream_id: DownstreamId,
21    pub channel_id: ChannelId,
22}
23
24impl From<(DownstreamId, ChannelId)> for VardiffKey {
25    fn from(value: (DownstreamId, ChannelId)) -> Self {
26        VardiffKey {
27            downstream_id: value.0,
28            channel_id: value.1,
29        }
30    }
31}