pub struct StewardListConfig {
pub sn_min: usize,
pub sn_max: usize,
pub allow_subset_candidates: bool,
}Expand description
Steward-list configuration set at conversation creation. The deterministic reference impl reads these bounds for size selection and validation; commit-batch and other unrelated knobs live elsewhere.
Fields§
§sn_min: usizeMinimum steward list size. If total members < sn_min, list size = total members.
sn_max: usizeMaximum steward list size.
allow_subset_candidates: boolWhether subset commit candidates are allowed during deterministic selection.
Implementations§
Source§impl StewardListConfig
impl StewardListConfig
Sourcepub fn new(sn_min: usize, sn_max: usize) -> Result<Self, CoreError>
pub fn new(sn_min: usize, sn_max: usize) -> Result<Self, CoreError>
Create a new config with the given bounds.
Returns Err if sn_min is 0 or sn_min > sn_max.
Sourcepub fn compute_list_size(&self, total_members: usize) -> usize
pub fn compute_list_size(&self, total_members: usize) -> usize
Preferred list size (the upper end of the valid range).
Sourcepub fn is_valid_size(&self, size: usize, total_members: usize) -> bool
pub fn is_valid_size(&self, size: usize, total_members: usize) -> bool
true iff size lies within the valid range for this config.
Trait Implementations§
Source§impl Clone for StewardListConfig
impl Clone for StewardListConfig
Source§fn clone(&self) -> StewardListConfig
fn clone(&self) -> StewardListConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StewardListConfig
impl Debug for StewardListConfig
Source§impl Default for StewardListConfig
impl Default for StewardListConfig
Source§fn default() -> Self
fn default() -> Self
Tiny-conversation defaults — sn ∈ [1, 2], subset candidates disallowed.
Adjust at User init via crate::app::User::set_default_steward_list_config.
Source§impl PartialEq for StewardListConfig
impl PartialEq for StewardListConfig
Source§fn eq(&self, other: &StewardListConfig) -> bool
fn eq(&self, other: &StewardListConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StewardListConfig
impl StructuralPartialEq for StewardListConfig
Auto Trait Implementations§
impl Freeze for StewardListConfig
impl RefUnwindSafe for StewardListConfig
impl Send for StewardListConfig
impl Sync for StewardListConfig
impl Unpin for StewardListConfig
impl UnsafeUnpin for StewardListConfig
impl UnwindSafe for StewardListConfig
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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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