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§

source§

impl TimestampMicros

source

pub fn new(parts: i64) -> Self

Returns a timestamp with the corresponding parts since the Unix Epoch.

source

pub fn to_total_parts(self) -> i64

Returns the total number of parts (e.g. microseconds or nanoseconds) since the Unix Epoch.

Trait Implementations§

source§

impl Clone for TimestampMicros

source§

fn clone(&self) -> TimestampMicros

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TimestampMicros

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TimestampMicros

source§

fn default() -> TimestampMicros

Returns the “default value” for a type. Read more
source§

impl Display for TimestampMicros

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<TimestampMicros> for SystemTime

source§

fn from(value: TimestampMicros) -> SystemTime

Converts to this type from the input type.
source§

impl NumberLike for TimestampMicros

source§

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

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

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

The unsigned integer this type can convert between to do bitwise logic and such.
source§

fn to_unsigned(self) -> u64

Used during compression to convert to an unsigned integer.
source§

fn from_unsigned(off: u64) -> Self

Used during decompression to convert back from an unsigned integer.
source§

fn to_signed(self) -> i64

Used during delta encoding to convert to a signed integer.
source§

fn from_signed(signed: i64) -> Self

Used during delta decoding to convert back from a signed integer.
source§

fn to_bytes(self) -> Vec<u8>

Returns an uncompressed representation for the number.
source§

fn from_bytes(bytes: &[u8]) -> QCompressResult<Self>

Creates a number from an uncompressed representation.
source§

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>

Parses an uncompressed representation of the number from the BitReader.
source§

fn write_to(self, writer: &mut BitWriter)

Appends an uncompressed representation of the number to the BitWriter.
source§

impl PartialEq<TimestampMicros> for TimestampMicros

source§

fn eq(&self, other: &TimestampMicros) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<SystemTime> for TimestampMicros

§

type Error = QCompressError

The type returned in the event of a conversion error.
source§

fn try_from(system_time: SystemTime) -> QCompressResult<Self>

Performs the conversion.
source§

impl Copy for TimestampMicros

source§

impl Eq for TimestampMicros

source§

impl StructuralEq for TimestampMicros

source§

impl StructuralPartialEq for TimestampMicros

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.