Struct fog_pack::types::Timestamp [−][src]
pub struct Timestamp { /* fields omitted */ }Expand description
Structure for holding a raw fog-pack timestamp. This stores time in some consistent internal format, which may or may not be UTC. UTC time can always be extracted from it.
Implementations
Create a timestamp from a raw seconds + nanoseconds value
Add 1 nanosecond to timestamp. Will go into leap second (nanoseconds > 1e6) before it goes to the next second.
Subtract 1 nanosecond from timestamp. Will go into leap second (nanoseconds > 1e6) when it must decrement a second.
Return the UNIX timestamp (number of seconds since January 1, 1970 0:00:00 UTC). As a reminder, this is UTC time and thus includes leap seconds.
Returns the number of nanoseconds past the second count.
Convert into a byte vector. For extending an existing byte vector, see
encode_vec.
Encode onto a byte vector one of 3 formats:
- If nanoseconds is nonzero, encode the standard byte, the seconds as little-endian i64, and the nanoseconds as little-endian u32.
- If nanoseconds is zero & seconds maps to a u32, encode the standard byte, and the seconds as little-endian u32.
- If nanoseconds is zero & seconds does not map to a u32, encode the standard byte, and the seconds as little-endian i64.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
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
Auto Trait Implementations
impl RefUnwindSafe for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self