pub struct EntryId { /* private fields */ }Expand description
A Redis Streams entry id: the <milliseconds>-<sequence> pair the server assigns to every
entry.
Parsed on construction, so a value of this type is always a well-formed id and comparisons
order entries the way the stream does. The <milliseconds> half alone is accepted too
("1700000000000" means 1700000000000-0), matching what Redis accepts on the wire.
§Examples
use ruststream_fred::EntryId;
let id: EntryId = "1700000000000-4".parse()?;
assert_eq!(id.milliseconds(), 1_700_000_000_000);
assert_eq!(id.sequence(), 4);
assert_eq!(id.to_string(), "1700000000000-4");Implementations§
Source§impl EntryId
impl EntryId
Sourcepub const ZERO: Self
pub const ZERO: Self
The lowest id the stream can express, below every real entry (Redis rejects 0-0 as an
entry id, so nothing can sit at it).
Sourcepub const fn milliseconds(&self) -> u64
pub const fn milliseconds(&self) -> u64
The <milliseconds> half: the entry’s server-side timestamp.
Trait Implementations§
impl Copy for EntryId
impl Eq for EntryId
Source§impl Ord for EntryId
impl Ord for EntryId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for EntryId
impl PartialOrd for EntryId
impl StructuralPartialEq for EntryId
Auto Trait Implementations§
impl Freeze for EntryId
impl RefUnwindSafe for EntryId
impl Send for EntryId
impl Sync for EntryId
impl Unpin for EntryId
impl UnsafeUnpin for EntryId
impl UnwindSafe for EntryId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more