Struct sttp::Ticks

source ·
pub struct Ticks { /* private fields */ }
Expand description

Represents a 64-bit integer used to designate time in STTP. The value represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 UTC, Gregorian calendar.

A single tick represents one hundred nanoseconds, or one ten-millionth of a second. There are 10,000 ticks in a millisecond and 10 million ticks in a second. Only bits 01 to 62 (0x3FFFFFFFFFFFFFFF) are used to represent the timestamp value. Bit 64 (0x8000000000000000) is used to denote leap second, i.e., second 60, where actual second value would remain at 59. Bit 63 (0x4000000000000000) is used to denote leap second direction, 0 for add, 1 for delete.

Implementations§

Number of Ticks that occur in a second.

Number of Ticks that occur in a millisecond.

Number of Ticks that occur in a microsecond.

Number of Ticks that occur in a minute.

Number of Ticks that occur in an hour.

Number of Ticks that occur in a day.

Flag (64th bit) that marks a Ticks value as a leap second, i.e., second 60 (one beyond normal second 59).

Flag (63rd bit) that indicates if leap second is positive or negative; 0 for add, 1 for delete.

All bits (bits 1 to 62) that make up the value portion of a Ticks that represent time.

Ticks representation of the Unix epoch timestamp starting at January 1, 1970.

Creates a Ticks value.

Gets the timestamp portion of the Ticks value, i.e., the 62-bit time value excluding any leap second flags.

Converts a standard Rust DateTime value to a Ticks value.

Converts a standard Rust Duration value to a Ticks value.

Converts a Ticks value to standard Rust DateTime value.

Determines if the deserialized Ticks value represents a leap second, i.e., second 60.

Returns a copy of this Ticks value flagged to represent a leap second, i.e., second 60, before wire serialization.

Updates this Ticks value to represent a leap second, i.e., second 60, before wire serialization.

Determines if the deserialized Ticks value represents a negative leap second, i.e., checks flag on second 58 to see if second 59 will be missing.

Returns a copy of this Ticks value flagged to represent a negative leap second, i.e., sets flag on second 58 to mark that second 59 will be missing, before wire serialization.

Updates this Ticks value to represent a negative leap second, i.e., sets flag on second 58 to mark that second 59 will be missing, before wire serialization.

Gets the current local time as a Ticks value.

Gets the current time in UTC as a Ticks value.

Standard timestamp representation for a Ticks value, e.g., 2006-01-02 15:04:05.999999999.

Shows just the timestamp portion of a Ticks value with milliseconds, e.g., 15:04:05.999.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
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
The resulting type after applying the / operator.
Performs the / operation. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more

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