pub struct TimestampNanos(_);
Expand description

A nanosecond-precise, timezone-naive timestamp.

All q_compress timestamps use a signed 64 bit integer for the number of seconds since the Unix Epoch, which is a range of about +/- 500 million years. This is (generally) the most generous timestamp range standard used by other major tools today.

TimestampNanos in particular have fine enough granularity to losslessly convert timestamps for any operating system or (generally) major tool.

Implementations

Returns a timestamp with the corresponding parts since the Unix Epoch. Will return an error if outside the bounds of a 64-bit signed integer for seconds and 32-bit unsigned integer for fractional parts.

Returns a timestamp with the corresponding seconds and fractional nanoseconds since the Unix Epoch.

Returns the (seconds, subsec_nanos) since the Unix Epoch.

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

Return an error if the timestamp is out of range.

Valid timestamps fit into a 64-bit signed integer for seconds and 32-bit unsigned integer for the fractional part of the second. However, the in-memory representation uses a 128-bit signed integer for the total number of fractional parts. It is theoretically possible for a corrupt delta-encoded file to cause a decompressor to return invalid timestamps. If you are concerned about a data corruption affecting such a case without being noticed, you may want to .validate() every returned timestamp. Otherwise, it is possible that a panic occurs when you try to use the corrupt timestamps.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

A number from 0-255 that corresponds to the number’s data type. Read more

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). Read more

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. Read more

The unsigned integer this type can convert between to do bitwise logic and such. Read more

Used during compression to convert to an unsigned integer.

Used during decompression to convert back from an unsigned integer.

Used during delta encoding to convert to a signed integer.

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

Returns an uncompressed representation for the number.

Creates a number from an uncompressed representation.

Lossless check for bit-exact equality. This is important because not all data types support full ordering: https://stackoverflow.com/questions/26489701/why-does-rust-not-implement-total-ordering-via-the-ord-trait-for-f64-and-f32. Read more

Parses an uncompressed representation of the number from the BitReader. Read more

Appends an uncompressed representation of the number to the BitWriter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.