pub struct Timestamp {
pub nanos: i64,
}Expand description
A point in time — std/time/v1/Timestamp, nanoseconds since the Unix
epoch, timezone-less.
Fields§
§nanos: i64Nanoseconds since the Unix epoch.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
A timestamp at nanos since the epoch.
Sourcepub const fn seconds(self) -> i64
pub const fn seconds(self) -> i64
The whole seconds since the epoch, rounding towards negative infinity so a pre-epoch stamp’s sub-second part stays non-negative.
Sourcepub fn subsec_nanos(self) -> u32
pub fn subsec_nanos(self) -> u32
The nanoseconds past Timestamp::seconds, always in 0..1e9.
Sourcepub fn to_hlc(self, counter: u32) -> HlcTimestamp
pub fn to_hlc(self, counter: u32) -> HlcTimestamp
The matching astrs_time::HlcTimestamp reading, with counter as
its logical component.
Sourcepub fn from_hlc(hlc: HlcTimestamp) -> Self
pub fn from_hlc(hlc: HlcTimestamp) -> Self
The timestamp an astrs_time::HlcTimestamp names.
Trait Implementations§
Source§impl AstrsMessage for Timestamp
impl AstrsMessage for Timestamp
Source§const URN: &'static str = "std/time/v1/Timestamp"
const URN: &'static str = "std/time/v1/Timestamp"
The type URN this message’s columnar layout is declared against
(blueprint §24.3), e.g.
"std/vision/v1/Detections".Source§fn data_type() -> DataType
fn data_type() -> DataType
The columnar layout
AstrsMessage::to_record_batch produces and
AstrsMessage::from_record_batch expects.Source§fn to_record_batch(&self) -> Result<RecordBatch>
fn to_record_batch(&self) -> Result<RecordBatch>
Encodes one message into a one-row
RecordBatch (blueprint §6.1’s
“one record batch per message”). Read moreSource§fn from_record_batch(batch: &RecordBatch) -> Result<Self>
fn from_record_batch(batch: &RecordBatch) -> Result<Self>
Decodes one message from a one-row
RecordBatch. Read moreSource§fn schema() -> Schema
fn schema() -> Schema
The single-column
Schema wrapping AstrsMessage::data_type
under crate::DATA_COLUMN (blueprint §6.1).Source§fn type_urn() -> Result<TypeUrn, TypeUrnError>
fn type_urn() -> Result<TypeUrn, TypeUrnError>
Parses
AstrsMessage::URN. Read moreimpl Copy for Timestamp
impl Eq for Timestamp
Source§impl FromPayload for Timestamp
impl FromPayload for Timestamp
Source§fn from_batch(batch: &RecordBatch) -> Result<Self>
fn from_batch(batch: &RecordBatch) -> Result<Self>
Reads the value from a decoded payload batch. Read more
Source§impl Ord for Timestamp
impl Ord for Timestamp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations§
impl<T> Allocation for T
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