pub struct TermFence<S>where
S: TermStore,{ /* private fields */ }Expand description
The stale-term fence. Wraps a durable TermStore and applies the term
rule at the apply and handshake boundaries.
Implementations§
Source§impl<S> TermFence<S>where
S: TermStore,
impl<S> TermFence<S>where
S: TermStore,
pub fn new(store: S) -> TermFence<S>
Sourcepub fn current_term(&self) -> Result<u64, TermStoreError>
pub fn current_term(&self) -> Result<u64, TermStoreError>
The node’s current (highest adopted) term.
Sourcepub fn classify(
&self,
boundary: FenceBoundary,
incoming_term: u64,
) -> Result<FenceVerdict, TermStoreError>
pub fn classify( &self, boundary: FenceBoundary, incoming_term: u64, ) -> Result<FenceVerdict, TermStoreError>
Classify incoming_term against the current term without mutating
anything. Pure read — useful for probing a decision before committing
to the adoption side-effect.
Sourcepub fn admit_record(
&self,
incoming_term: u64,
) -> Result<FenceVerdict, TermStoreError>
pub fn admit_record( &self, incoming_term: u64, ) -> Result<FenceVerdict, TermStoreError>
Admit (or fence) a term-stamped record at the apply boundary. On a
newer term the fence adopts it durably before returning Adopt.
Sourcepub fn admit_handshake(
&self,
incoming_term: u64,
) -> Result<FenceVerdict, TermStoreError>
pub fn admit_handshake( &self, incoming_term: u64, ) -> Result<FenceVerdict, TermStoreError>
Admit (or fence) a stream handshake declaring incoming_term. On a
newer term the fence adopts it durably before returning Adopt.
Auto Trait Implementations§
impl<S> Freeze for TermFence<S>where
S: Freeze,
impl<S> RefUnwindSafe for TermFence<S>where
S: RefUnwindSafe,
impl<S> Send for TermFence<S>where
S: Send,
impl<S> Sync for TermFence<S>where
S: Sync,
impl<S> Unpin for TermFence<S>where
S: Unpin,
impl<S> UnsafeUnpin for TermFence<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for TermFence<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request