pub struct Sequenced<T> {
pub value: T,
/* private fields */
}Expand description
A wrapper that adds automatic sequencing to any value for temporal ordering.
Uses a monotonically increasing sequence counter to establish a total ordering of events. The sequence is assigned when the value is created.
Fields§
§value: TImplementations§
Source§impl<T> Sequenced<T>
impl<T> Sequenced<T>
Sourcepub fn new(value: T) -> Self
pub fn new(value: T) -> Self
Creates a new timestamped value with an automatically assigned sequence number.
pub fn with_timestamp(value: T, timestamp: u64) -> Self
pub fn into_inner(self) -> T
Trait Implementations§
Source§impl<T> HasTimestamp for Sequenced<T>
impl<T> HasTimestamp for Sequenced<T>
Source§impl<T> Ord for Sequenced<T>where
T: Eq,
impl<T> Ord for Sequenced<T>where
T: Eq,
Source§impl<T> PartialOrd for Sequenced<T>where
T: Eq,
impl<T> PartialOrd for Sequenced<T>where
T: Eq,
Source§impl<T> Timestamped for Sequenced<T>
impl<T> Timestamped for Sequenced<T>
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Consumes self and returns the inner value.
For wrapper types like
Sequenced<T>, this extracts T.
For domain types where Inner = Self, this typically returns self.Source§fn with_timestamp(value: Self::Inner, timestamp: Self::Timestamp) -> Self
fn with_timestamp(value: Self::Inner, timestamp: Self::Timestamp) -> Self
Creates a new instance wrapping the given value with the specified timestamp.
impl<T: Eq> Eq for Sequenced<T>
Auto Trait Implementations§
impl<T> Freeze for Sequenced<T>where
T: Freeze,
impl<T> RefUnwindSafe for Sequenced<T>where
T: RefUnwindSafe,
impl<T> Send for Sequenced<T>where
T: Send,
impl<T> Sync for Sequenced<T>where
T: Sync,
impl<T> Unpin for Sequenced<T>where
T: Unpin,
impl<T> UnwindSafe for Sequenced<T>where
T: UnwindSafe,
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