pub struct ScopeConfig {
pub network_type: NetworkType,
pub default_consensus_threshold: f64,
pub default_timeout: Duration,
pub default_liveness_criteria_yes: bool,
pub max_rounds_override: Option<u32>,
}Expand description
Scope-level configuration that applies to all proposals in a scope.
This provides default settings for proposals created in a scope. Individual proposals can override these defaults if needed.
Fields§
§network_type: NetworkTypeNetwork type: P2P or Gossipsub
default_consensus_threshold: f64Default consensus threshold (e.g., 2/3 = 0.667)
default_timeout: DurationDefault timeout for proposals in this scope
default_liveness_criteria_yes: boolDefault liveness criteria (how silent peers are counted)
max_rounds_override: Option<u32>Optional: Max rounds override (if None, uses network_type defaults)
Implementations§
Source§impl ScopeConfig
impl ScopeConfig
Sourcepub fn validate(&self) -> Result<(), ConsensusError>
pub fn validate(&self) -> Result<(), ConsensusError>
Validate the configuration
Trait Implementations§
Source§impl Clone for ScopeConfig
impl Clone for ScopeConfig
Source§fn clone(&self) -> ScopeConfig
fn clone(&self) -> ScopeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScopeConfig
impl Debug for ScopeConfig
Source§impl Default for ScopeConfig
impl Default for ScopeConfig
Source§impl From<NetworkType> for ScopeConfig
impl From<NetworkType> for ScopeConfig
Source§fn from(network_type: NetworkType) -> Self
fn from(network_type: NetworkType) -> Self
Converts to this type from the input type.
Source§impl From<ScopeConfig> for ConsensusConfig
impl From<ScopeConfig> for ConsensusConfig
Source§fn from(config: ScopeConfig) -> Self
fn from(config: ScopeConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScopeConfig
impl RefUnwindSafe for ScopeConfig
impl Send for ScopeConfig
impl Sync for ScopeConfig
impl Unpin for ScopeConfig
impl UnwindSafe for ScopeConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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