[][src]Struct debra_common::epoch::Epoch

pub struct Epoch(_);

A monotonically increasing epoch counter with wrapping overflow behaviour.

Methods

impl Epoch[src]

pub fn new() -> Self[src]

Creates a new Epoch starting at zero.

pub fn relative_age(
    self,
    global_epoch: Epoch
) -> Result<PossibleAge, Undetermined>
[src]

Returns the PossibleAge of the epoch relative to global_epoch.

Since the global epoch is explicitly allowed to wrap around, it is not possible to unambiguously determine the relative age of an epoch. However, since epochs are monotonically increasing it is certain that any previously observed epoch must be older of equal than the global epoch. Consequently, it is possible to determine if an epoch could be within the critical range of two epochs, during which reclamation of records must be avoided, and is in order to be conservative.

Trait Implementations

impl Ord for Epoch[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Clone for Epoch[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for Epoch[src]

impl Default for Epoch[src]

impl PartialEq<Epoch> for Epoch[src]

impl Eq for Epoch[src]

impl PartialOrd<Epoch> for Epoch[src]

impl Debug for Epoch[src]

impl Display for Epoch[src]

impl Add<usize> for Epoch[src]

type Output = Self

The resulting type after applying the + operator.

impl Sub<usize> for Epoch[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl Sync for Epoch

impl Unpin for Epoch

impl Send for Epoch

impl UnwindSafe for Epoch

impl RefUnwindSafe for Epoch

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self