Struct bonsaidb_core::keyvalue::Timestamp
source · [−]Expand description
A timestamp relative to UNIX_EPOCH.
Fields
seconds: u64The number of whole seconds since UNIX_EPOCH.
nanos: u32The number of nanoseconds in the timestamp.
Implementations
sourceimpl Timestamp
impl Timestamp
sourcepub const MIN: Self
pub const MIN: Self
The minimum representable Timestamp. This is equivalent to UNIX_EPOCH.
sourcepub fn now() -> Self
pub fn now() -> Self
Returns the current timestamp according to the OS. Uses SystemTime::now().
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
sourcefn 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
sourceimpl From<SystemTime> for Timestamp
impl From<SystemTime> for Timestamp
sourcefn from(time: SystemTime) -> Self
fn from(time: SystemTime) -> Self
Converts to this type from the input type.
sourceimpl<'a> Key<'a> for Timestamp
impl<'a> Key<'a> for Timestamp
sourcefn from_ord_bytes(bytes: &'a [u8]) -> Result<Self, Self::Error>
fn from_ord_bytes(bytes: &'a [u8]) -> Result<Self, Self::Error>
Deserialize a sequence of bytes previously encoded with
KeyEncoding::as_ord_bytes. Read more
sourcefn first_value() -> Result<Self, NextValueError>
fn first_value() -> Result<Self, NextValueError>
Return the first value in sequence for this type. Not all types implement this. Read more
sourcefn next_value(&self) -> Result<Self, NextValueError>
fn next_value(&self) -> Result<Self, NextValueError>
Return the next value in sequence for this type. Not all types implement this. Instead of wrapping/overflowing, None should be returned. Read more
sourceimpl<'a> KeyEncoding<'a, Timestamp> for Timestamp
impl<'a> KeyEncoding<'a, Timestamp> for Timestamp
sourceimpl Ord for Timestamp
impl Ord for Timestamp
sourceimpl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> for Timestamp
sourcefn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralEq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more