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 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
Performs the conversion.
sourceimpl<'a> Key<'a> for Timestamp
impl<'a> Key<'a> for Timestamp
type Error = IncorrectByteLength
type Error = IncorrectByteLength
The error type that can be produced by either serialization or deserialization. Read more
sourceconst LENGTH: Option<usize>
const LENGTH: Option<usize>
The size of the key, if constant. If this type doesn’t produce the same
number of bytes for each value, this should be None. Read more
sourcefn as_ord_bytes(&'a self) -> Result<Cow<'a, [u8]>, Self::Error>
fn as_ord_bytes(&'a self) -> Result<Cow<'a, [u8]>, Self::Error>
Convert self into a Cow<[u8]> containing bytes that are able to be
compared via memcmp in a way that is comptaible with its own Ord
implementation. Read more
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
Self::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 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more