[][src]Struct exonum::blockchain::config::ConsensusConfigBuilder

pub struct ConsensusConfigBuilder { /* fields omitted */ }

Builder for ConsensusConfig.

Initially, ConsensusConfig in this builder is generated via ConsensusConfig::default(). Only the necessary fields can be updated before obtaining the build config via build method.

Examples

let consensus_config = ConsensusConfigBuilder::new()
    .first_round_timeout(3010)
    .min_propose_timeout(20)
    .build();

assert_eq!(consensus_config.first_round_timeout, 3010);
assert_eq!(consensus_config.min_propose_timeout, 20);
assert_eq!(consensus_config.status_timeout, ConsensusConfig::default().status_timeout);

Methods

impl ConsensusConfigBuilder[src]

pub fn new() -> Self[src]

Creates a new ConsensusConfigBuilder with ConsensusConfig initialized to its default value.

pub fn build(self) -> ConsensusConfig[src]

Finishes the building process, returning the ConsensusConfig object.

pub fn validator_keys(self, validator_keys: Vec<ValidatorKeys>) -> Self[src]

Sets the validator_keys field of ConsensusConfig.

pub fn first_round_timeout(self, first_round_timeout: Milliseconds) -> Self[src]

Sets the first_round_timeout field of ConsensusConfig.

pub fn status_timeout(self, status_timeout: Milliseconds) -> Self[src]

Sets the status_timeout field of ConsensusConfig.

pub fn peers_timeout(self, peers_timeout: Milliseconds) -> Self[src]

Sets the peers_timeout field of ConsensusConfig.

pub fn txs_block_limit(self, txs_block_limit: u32) -> Self[src]

Sets the txs_block_limit field of ConsensusConfig.

pub fn min_propose_timeout(self, min_propose_timeout: Milliseconds) -> Self[src]

Sets the min_propose_timeout field of ConsensusConfig.

pub fn max_propose_timeout(self, max_propose_timeout: Milliseconds) -> Self[src]

Sets the max_propose_timeout field of ConsensusConfig.

pub fn max_message_len(self, max_message_len: u32) -> Self[src]

Sets the max_message_len field of ConsensusConfig.

pub fn propose_timeout_threshold(self, propose_timeout_threshold: u32) -> Self[src]

Sets the propose_timeout_threshold field of ConsensusConfig.

Trait Implementations

impl Debug for ConsensusConfigBuilder[src]

impl Default for ConsensusConfigBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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