Struct q_compress::data_types::TimestampMicros
source · pub struct TimestampMicros(_);
Expand description
A microsecond-precise, timezone-naive, 64-bit timestamp.
All q_compress
64-bit timestamps use a single signed 64 bit integer
for the number of units since 1970.
This means that the date range can be somewhat limited; e.g.
TimestampNanos
covers from about year 1678 to 2262.
Constructors will panic if the input time lies outside the valid range
for this type.
Provides conversions to/from SystemTime
.
Implementations§
Trait Implementations§
source§impl Clone for TimestampMicros
impl Clone for TimestampMicros
source§fn clone(&self) -> TimestampMicros
fn clone(&self) -> TimestampMicros
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TimestampMicros
impl Debug for TimestampMicros
source§impl Default for TimestampMicros
impl Default for TimestampMicros
source§fn default() -> TimestampMicros
fn default() -> TimestampMicros
Returns the “default value” for a type. Read more
source§impl Display for TimestampMicros
impl Display for TimestampMicros
source§impl From<TimestampMicros> for SystemTime
impl From<TimestampMicros> for SystemTime
source§fn from(value: TimestampMicros) -> SystemTime
fn from(value: TimestampMicros) -> SystemTime
Converts to this type from the input type.
source§impl NumberLike for TimestampMicros
impl NumberLike for TimestampMicros
source§const HEADER_BYTE: u8 = 15u8
const HEADER_BYTE: u8 = 15u8
A number from 0-255 that corresponds to the number’s data type. Read more
source§const PHYSICAL_BITS: usize = 64usize
const PHYSICAL_BITS: usize = 64usize
The number of bits in the number’s uncompressed representation.
This must match the number of bytes in the
to_bytes
and from_bytes
implementations.
Note that booleans have 8 physical bits (not 1)
and timestamps have 96 (not 128).§type Signed = i64
type Signed = i64
The signed integer this type can convert between to do wrapped
subtraction and addition for delta encoding/decoding.
Must be another
NumberLike
with the same Signed
and Unsigned
as
this type; in this way, if we take 7th order deltas, they are ensured to
have the same type as 1st order deltas.§type Unsigned = u64
type Unsigned = u64
The unsigned integer this type can convert between to do
bitwise logic and such.
source§fn to_unsigned(self) -> u64
fn to_unsigned(self) -> u64
Used during compression to convert to an unsigned integer.
source§fn from_unsigned(off: u64) -> Self
fn from_unsigned(off: u64) -> Self
Used during decompression to convert back from an unsigned integer.
source§fn from_signed(signed: i64) -> Self
fn from_signed(signed: i64) -> Self
Used during delta decoding to convert back from a signed integer.
source§fn from_bytes(bytes: &[u8]) -> QCompressResult<Self>
fn from_bytes(bytes: &[u8]) -> QCompressResult<Self>
Creates a number from an uncompressed representation.
source§fn num_eq(&self, other: &Self) -> bool
fn num_eq(&self, other: &Self) -> bool
This is no longer important and will go away in a future release.
source§fn read_from(reader: &mut BitReader<'_>) -> QCompressResult<Self>
fn read_from(reader: &mut BitReader<'_>) -> QCompressResult<Self>
Parses an uncompressed representation of the number from the
BitReader
.source§impl PartialEq<TimestampMicros> for TimestampMicros
impl PartialEq<TimestampMicros> for TimestampMicros
source§fn eq(&self, other: &TimestampMicros) -> bool
fn eq(&self, other: &TimestampMicros) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<SystemTime> for TimestampMicros
impl TryFrom<SystemTime> for TimestampMicros
§type Error = QCompressError
type Error = QCompressError
The type returned in the event of a conversion error.
source§fn try_from(system_time: SystemTime) -> QCompressResult<Self>
fn try_from(system_time: SystemTime) -> QCompressResult<Self>
Performs the conversion.
impl Copy for TimestampMicros
impl Eq for TimestampMicros
impl StructuralEq for TimestampMicros
impl StructuralPartialEq for TimestampMicros
Auto Trait Implementations§
impl RefUnwindSafe for TimestampMicros
impl Send for TimestampMicros
impl Sync for TimestampMicros
impl Unpin for TimestampMicros
impl UnwindSafe for TimestampMicros
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