pub struct Epoch { /* private fields */ }Expand description
Implementations§
Source§impl Epoch
impl Epoch
Sourcepub const fn next_generation(self) -> Epoch
pub const fn next_generation(self) -> Epoch
Returns a future Epoch when the current readers will not be present.
The current Epoch may lag behind the global epoch value by 1, therefore this method
returns an Epoch three epochs next to self.
§Examples
use sdd::Epoch;
let initial = Epoch::default();
let next_generation = initial.next_generation();
assert_eq!(next_generation, initial.next().next().next());Sourcepub const fn in_same_generation(self, other: Epoch) -> bool
pub const fn in_same_generation(self, other: Epoch) -> bool
Checks if the current Epoch is in the same generation as the given Epoch.
This operation is not commutative, e.g., a.in_same_generation(b) is not the same as
b.in_same_generation(a). This returns true if the other Epoch is either the same
with the current one, the next one, or the next one after that. The meaning of false
returned by this method is that a memory region retired in the current Epoch will no
longer be reachable in the other Epoch.
§Examples
use sdd::Epoch;
let initial = Epoch::default();
let next_generation = initial.next_generation();
assert!(initial.in_same_generation(initial.next().next()));
assert!(!initial.in_same_generation(initial.next().next().next()));Trait Implementations§
Source§impl Ord for Epoch
impl Ord for Epoch
Source§impl PartialOrd for Epoch
impl PartialOrd for Epoch
impl Copy for Epoch
impl Eq for Epoch
impl StructuralPartialEq for Epoch
Auto Trait Implementations§
impl Freeze for Epoch
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnsafeUnpin for Epoch
impl UnwindSafe for Epoch
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