oa::Timestamp

Nanosecond-precision monotonic timestamp. Internally stores nanoseconds elapsed since an arbitrary monotonic origin. Two Timestamp values from the same process can be subtracted; the result is meaningful as a Duration. Do not compare values across processes.

StRust public API

Declaration

pub struct Timestamp { /* private fields */ }
Public Rust declaration.

Public Methods

pub const fn as_nanos(self) -> i64
pub fn to_secs(self) -> f64
pub fn to_ms(self) -> f64
pub fn is_valid(self) -> bool
fn add(self, rhs: Self) -> Self
fn add_assign(&mut self, rhs: Self)
fn clone(&self) -> Timestamp
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn hash<__H: Hasher>(&self, state: &mut __H)
fn cmp(&self, other: &Timestamp) -> Ordering
fn eq(&self, other: &Timestamp) -> bool
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
fn sub(self, rhs: Self) -> Self
fn sub_assign(&mut self, rhs: Self)

Associated Functions

pub fn now() -> Self
pub const fn zero() -> Self
pub const fn from_nanos(n: i64) -> Self
pub fn from_secs_f64(s: f64) -> Self

Public Method Documentation

pub const fn as_nanos( self ) -> i64
No public source comment is attached to this declaration.
pub fn to_secs( self ) -> f64
No public source comment is attached to this declaration.
pub fn to_ms( self ) -> f64
No public source comment is attached to this declaration.
pub fn is_valid( self ) -> bool
No public source comment is attached to this declaration.
fn add( self, rhs: Self ) -> Self
No public source comment is attached to this declaration.
fn add_assign( &mut self, rhs: Self )
No public source comment is attached to this declaration.
fn clone( &self ) -> Timestamp
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn hash<__H: Hasher>( &self, state: &mut __H )
No public source comment is attached to this declaration.
fn cmp( &self, other: &Timestamp ) -> Ordering
No public source comment is attached to this declaration.
fn eq( &self, other: &Timestamp ) -> bool
No public source comment is attached to this declaration.
fn partial_cmp( &self, other: &Timestamp ) -> Option<Ordering>
No public source comment is attached to this declaration.
fn sub( self, rhs: Self ) -> Self
No public source comment is attached to this declaration.
fn sub_assign( &mut self, rhs: Self )
No public source comment is attached to this declaration.
pub fn now() -> Self
No public source comment is attached to this declaration.
pub const fn zero() -> Self
No public source comment is attached to this declaration.
pub const fn from_nanos( n: i64 ) -> Self
No public source comment is attached to this declaration.
pub fn from_secs_f64( s: f64 ) -> Self
No public source comment is attached to this declaration.