pub struct ScopeConfigBuilderWrapper<Scope, S, E>{ /* private fields */ }Expand description
Wrapper around ScopeConfigBuilder that stores service and scope for convenience methods.
Implementations§
Source§impl<Scope, S, E> ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> ScopeConfigBuilderWrapper<Scope, S, E>
Sourcepub fn with_network_type(self, network_type: NetworkType) -> Self
pub fn with_network_type(self, network_type: NetworkType) -> Self
Set network type (P2P or Gossipsub)
Sourcepub fn with_threshold(self, threshold: f64) -> Self
pub fn with_threshold(self, threshold: f64) -> Self
Set consensus threshold (0.0 to 1.0)
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set default timeout for proposals (in seconds)
Sourcepub fn with_liveness_criteria(self, liveness_criteria_yes: bool) -> Self
pub fn with_liveness_criteria(self, liveness_criteria_yes: bool) -> Self
Set liveness criteria (how silent peers are counted)
Sourcepub fn with_max_rounds(self, max_rounds: Option<u32>) -> Self
pub fn with_max_rounds(self, max_rounds: Option<u32>) -> Self
Override max rounds (if None, uses network_type defaults)
Sourcepub fn p2p_preset(self) -> Self
pub fn p2p_preset(self) -> Self
Use P2P preset with common defaults
Sourcepub fn gossipsub_preset(self) -> Self
pub fn gossipsub_preset(self) -> Self
Use Gossipsub preset with common defaults
Sourcepub fn strict_consensus(self) -> Self
pub fn strict_consensus(self) -> Self
Use strict consensus (higher threshold = 0.9)
Sourcepub fn fast_consensus(self) -> Self
pub fn fast_consensus(self) -> Self
Use fast consensus (lower threshold = 0.6, shorter timeout = 30s)
Sourcepub fn with_network_defaults(self, network_type: NetworkType) -> Self
pub fn with_network_defaults(self, network_type: NetworkType) -> Self
Start with network-specific defaults
Sourcepub async fn initialize(self) -> Result<(), ConsensusError>
pub async fn initialize(self) -> Result<(), ConsensusError>
Initialize scope with the built configuration
Sourcepub async fn update(self) -> Result<(), ConsensusError>
pub async fn update(self) -> Result<(), ConsensusError>
Update existing scope configuration with the built configuration
Sourcepub fn get_config(&self) -> ScopeConfig
pub fn get_config(&self) -> ScopeConfig
Get the current configuration (useful for testing)
Auto Trait Implementations§
impl<Scope, S, E> Freeze for ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> RefUnwindSafe for ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> Send for ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> Sync for ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> Unpin for ScopeConfigBuilderWrapper<Scope, S, E>
impl<Scope, S, E> UnwindSafe for ScopeConfigBuilderWrapper<Scope, S, E>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more