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>

source

pub fn new(state: State, server_id: u8) -> Self

source

pub fn with_host(self, host: &str) -> Self

source

pub fn with_port(self, port: u16) -> Self

source

pub fn with_api_host(self, host: &str) -> Self

source

pub fn with_api_port(self, port: u16) -> Self

source

pub fn with_max_connections(self, max_connections: usize) -> Self

source

pub fn with_proxy(self, value: bool) -> Self

source

pub fn with_var_diff(self, value: bool) -> Self

source

pub fn with_minimum_difficulty(self, difficulty: u64) -> Self

source

pub fn with_maximum_difficulty(self, difficulty: u64) -> Self

source

pub fn with_retarget_time(self, time: u64) -> Self

source

pub fn with_target_time(self, time: u64) -> Self

source

pub fn with_variance_percent(self, percent: f64) -> Self

source

pub fn with_initial_difficulty(self, difficulty: u64) -> Self

source

pub fn with_ready_indicator(self, ready_indicator: ReadyIndicator) -> Self

source

pub fn with_shutdown_message(self, msg: Buffer) -> Self

source

pub fn with_cancel_token(self, token: CancellationToken) -> Self

source

pub fn with_ban_manager(self, enabled: bool) -> Self

source

pub async fn build(self) -> Result<StratumServer<State, CState>>

Trait Implementations§

source§

impl<State: Default, CState: Default> Default for StratumServerBuilder<State, CState>

source§

fn default() -> StratumServerBuilder<State, CState>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<State, CState> RefUnwindSafe for StratumServerBuilder<State, CState>
where CState: RefUnwindSafe, State: RefUnwindSafe,

§

impl<State, CState> Send for StratumServerBuilder<State, CState>
where CState: Send, State: Send,

§

impl<State, CState> Sync for StratumServerBuilder<State, CState>
where CState: Sync, State: Sync,

§

impl<State, CState> Unpin for StratumServerBuilder<State, CState>
where CState: Unpin, State: Unpin,

§

impl<State, CState> UnwindSafe for StratumServerBuilder<State, CState>
where CState: UnwindSafe, State: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more