pub struct TermLength(/* private fields */);Expand description
Number of consecutive views in which a leader remains stable (a “term”).
When the term length is 1, every view is its own term and each view has an independently elected leader. When greater than 1, views are grouped into terms and the same leader serves for every view in the term.
Unlike ViewDelta, which represents an offset added to or subtracted from
a view, a term length is a period that partitions the view space. It is
always non-zero.
§Consensus-Critical
The term length is consensus-critical configuration (like the namespace or participant set): it is local, is not carried by any vote or certificate, and nothing in the protocol detects a mismatch. All participants must configure the same value. Term boundaries determine which views a nullification covers, leader election, and when finalize votes are withheld, so mismatched participants silently disagree on view transitions and vote safety without producing any fault evidence. Only change the term length when all participants change it together (e.g., at an epoch boundary).
Longer terms also widen the window of unverified votes a participant may buffer while finalization stalls: votes are accepted for any view between the highest finalized view and the current view, and the current view advances by up to a full term per nullification.
Implementations§
Source§impl TermLength
impl TermLength
Sourcepub const MAX: Self
pub const MAX: Self
The maximum term length. Lengths are stored as a u32, bounding term
arithmetic (like View::next_term_start) away from u64 overflow
for any realistic view.
Sourcepub const ONE: Self
pub const ONE: Self
A term length of one view (every view has an independently elected leader).
Sourcepub const fn new(length: NonZeroU32) -> Self
pub const fn new(length: NonZeroU32) -> Self
Creates a new term length.
Trait Implementations§
Source§impl Clone for TermLength
impl Clone for TermLength
Source§fn clone(&self) -> TermLength
fn clone(&self) -> TermLength
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TermLength
Source§impl Debug for TermLength
impl Debug for TermLength
Source§impl Default for TermLength
impl Default for TermLength
Source§impl Display for TermLength
impl Display for TermLength
impl Eq for TermLength
Source§impl Hash for TermLength
impl Hash for TermLength
Source§impl PartialEq for TermLength
impl PartialEq for TermLength
impl StructuralPartialEq for TermLength
Auto Trait Implementations§
impl Freeze for TermLength
impl RefUnwindSafe for TermLength
impl Send for TermLength
impl Sync for TermLength
impl Unpin for TermLength
impl UnsafeUnpin for TermLength
impl UnwindSafe for TermLength
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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