pub struct Btic { /* private fields */ }Expand description
A Binary Temporal Interval Codec value.
Represents a half-open temporal interval [lo, hi) in milliseconds since
the Unix epoch (1970-01-01T00:00:00.000Z), with per-bound granularity and
certainty metadata packed into a 64-bit meta word.
The 24-byte packed canonical form supports memcmp-based ordering for
B-tree and LSM key storage.
Implementations§
Source§impl Btic
impl Btic
Sourcepub fn new(lo: i64, hi: i64, meta: u64) -> Result<Self, BticError>
pub fn new(lo: i64, hi: i64, meta: u64) -> Result<Self, BticError>
Construct a new BTIC value, validating all invariants (INV-1 through INV-7).
Sourcepub fn build_meta(
lo_gran: Granularity,
hi_gran: Granularity,
lo_cert: Certainty,
hi_cert: Certainty,
) -> u64
pub fn build_meta( lo_gran: Granularity, hi_gran: Granularity, lo_cert: Certainty, hi_cert: Certainty, ) -> u64
Build a meta word from granularity and certainty values.
Sourcepub fn lo_granularity(&self) -> Granularity
pub fn lo_granularity(&self) -> Granularity
Lower bound granularity.
Sourcepub fn hi_granularity(&self) -> Granularity
pub fn hi_granularity(&self) -> Granularity
Upper bound granularity.
Sourcepub fn lo_certainty(&self) -> Certainty
pub fn lo_certainty(&self) -> Certainty
Lower bound certainty.
Sourcepub fn hi_certainty(&self) -> Certainty
pub fn hi_certainty(&self) -> Certainty
Upper bound certainty.
Sourcepub fn duration_ms(&self) -> Option<i64>
pub fn duration_ms(&self) -> Option<i64>
Duration in milliseconds. None if either bound is infinite.
Sourcepub fn is_instant(&self) -> bool
pub fn is_instant(&self) -> bool
True if this is an instant (one millisecond wide).
Sourcepub fn is_unbounded(&self) -> bool
pub fn is_unbounded(&self) -> bool
True if either bound is infinite.
Trait Implementations§
impl Copy for Btic
Source§impl<'de> Deserialize<'de> for Btic
impl<'de> Deserialize<'de> for Btic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Btic
Source§impl Ord for Btic
impl Ord for Btic
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 Btic
impl PartialOrd for Btic
impl StructuralPartialEq for Btic
Auto Trait Implementations§
impl Freeze for Btic
impl RefUnwindSafe for Btic
impl Send for Btic
impl Sync for Btic
impl Unpin for Btic
impl UnsafeUnpin for Btic
impl UnwindSafe for Btic
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