Struct bonsaidb_core::keyvalue::Timestamp
source · pub struct Timestamp {
pub seconds: u64,
pub nanos: u32,
}
Expand description
A timestamp relative to UNIX_EPOCH
.
Fields§
§seconds: u64
The number of whole seconds since UNIX_EPOCH
.
nanos: u32
The number of nanoseconds in the timestamp.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
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
source§impl From<SystemTime> for Timestamp
impl From<SystemTime> for Timestamp
source§fn from(time: SystemTime) -> Self
fn from(time: SystemTime) -> Self
Converts to this type from the input type.
source§impl<'k> Key<'k> for Timestamp
impl<'k> Key<'k> for Timestamp
source§const CAN_OWN_BYTES: bool = false
const CAN_OWN_BYTES: bool = false
If true, this type can benefit from an owned
Vec<u8>
. This flag is
used as a hint of whether to attempt to do memcpy operations in some
decoding operations to avoid extra allocations.source§fn from_ord_bytes<'e>(bytes: ByteSource<'k, 'e>) -> Result<Self, Self::Error>
fn from_ord_bytes<'e>(bytes: ByteSource<'k, 'e>) -> Result<Self, Self::Error>
Deserialize a sequence of bytes previously encoded with
KeyEncoding::as_ord_bytes
.source§fn 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.
source§fn 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.
source§impl KeyEncoding<Timestamp> for Timestamp
impl KeyEncoding<Timestamp> for Timestamp
§type Error = IncorrectByteLength
type Error = IncorrectByteLength
The error type that can be produced by either serialization or
deserialization.
source§const 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
.source§fn describe<Visitor>(visitor: &mut Visitor)where
Visitor: KeyVisitor,
fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,
Describes this type by invoking functions on
visitor
describing the
key being encoded. Read moresource§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq<Timestamp> for Timestamp
impl PartialEq<Timestamp> for Timestamp
source§impl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> for Timestamp
1.0.0 · source§fn 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 moreimpl 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§
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