pub struct VectorClockPointer<T, const N: usize> { /* private fields */ }Expand description
Pointer + vector clock. Useful for distributed CRDT-style snapshot reads where causal-but-concurrent updates must be surfaced rather than ordered.
Implementations§
Source§impl<T, const N: usize> VectorClockPointer<T, N>
impl<T, const N: usize> VectorClockPointer<T, N>
pub const fn new(target: Arc<T>, clock: VectorClock<N>) -> Self
pub fn clock(&self) -> VectorClock<N>
pub fn target(&self) -> &Arc<T> ⓘ
Sourcepub fn read_at(&self, snapshot: VectorClock<N>) -> Option<&T>
pub fn read_at(&self, snapshot: VectorClock<N>) -> Option<&T>
Returns the target if it causally precedes or equals
snapshot. Returns None for concurrent / future events.
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for VectorClockPointer<T, N>
impl<T, const N: usize> RefUnwindSafe for VectorClockPointer<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for VectorClockPointer<T, N>
impl<T, const N: usize> Sync for VectorClockPointer<T, N>
impl<T, const N: usize> Unpin for VectorClockPointer<T, N>
impl<T, const N: usize> UnsafeUnpin for VectorClockPointer<T, N>
impl<T, const N: usize> UnwindSafe for VectorClockPointer<T, N>where
T: RefUnwindSafe,
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