Struct stratum_server::StratumServerBuilder
source · pub struct StratumServerBuilder<State, CState> {Show 13 fields
pub server_id: u8,
pub host: String,
pub port: u16,
pub api_host: String,
pub api_port: u16,
pub connection_config: ConnectionConfig,
pub var_diff_config: DifficultyConfig,
pub state: State,
pub connection_state: PhantomData<CState>,
pub ready_indicator: ReadyIndicator,
pub shutdown_message: Option<Buffer>,
pub cancel_token: Option<CancellationToken>,
pub ban_manager_enabled: bool,
}
Fields§
§server_id: u8
§host: String
§port: u16
§api_host: String
§api_port: u16
§connection_config: ConnectionConfig
§var_diff_config: DifficultyConfig
§state: State
§connection_state: PhantomData<CState>
§ready_indicator: ReadyIndicator
§shutdown_message: Option<Buffer>
§cancel_token: Option<CancellationToken>
§ban_manager_enabled: bool
Implementations§
source§impl<State: Clone + Send + Sync + 'static, CState: Default + Clone + Send + Sync + 'static> StratumServerBuilder<State, CState>
impl<State: Clone + Send + Sync + 'static, CState: Default + Clone + Send + Sync + 'static> StratumServerBuilder<State, CState>
pub fn new(state: State, server_id: u8) -> Self
pub fn with_host(self, host: &str) -> Self
pub fn with_port(self, port: u16) -> Self
pub fn with_api_host(self, host: &str) -> Self
pub fn with_api_port(self, port: u16) -> Self
pub fn with_max_connections(self, max_connections: usize) -> Self
pub fn with_proxy(self, value: bool) -> Self
pub fn with_var_diff(self, value: bool) -> Self
pub fn with_minimum_difficulty(self, difficulty: u64) -> Self
pub fn with_maximum_difficulty(self, difficulty: u64) -> Self
pub fn with_retarget_time(self, time: u64) -> Self
pub fn with_target_time(self, time: u64) -> Self
pub fn with_variance_percent(self, percent: f64) -> Self
pub fn with_initial_difficulty(self, difficulty: u64) -> Self
pub fn with_ready_indicator(self, ready_indicator: ReadyIndicator) -> Self
pub fn with_shutdown_message(self, msg: Buffer) -> Self
pub fn with_cancel_token(self, token: CancellationToken) -> Self
pub fn with_ban_manager(self, enabled: bool) -> Self
pub async fn build(self) -> Result<StratumServer<State, CState>>
Trait Implementations§
Auto Trait Implementations§
impl<State, CState> RefUnwindSafe for StratumServerBuilder<State, CState>where
CState: RefUnwindSafe,
State: RefUnwindSafe,
impl<State, CState> Send for StratumServerBuilder<State, CState>
impl<State, CState> Sync for StratumServerBuilder<State, CState>
impl<State, CState> Unpin for StratumServerBuilder<State, CState>
impl<State, CState> UnwindSafe for StratumServerBuilder<State, CState>where
CState: UnwindSafe,
State: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more