Struct questdb::ingress::TimestampNanos
source · pub struct TimestampNanos(/* private fields */);
Expand description
A i64
timestamp expressed as nanoseconds since the UNIX epoch (UTC).
Examples
use questdb::ingress::TimestampNanos;
let ts = TimestampNanos::now();
or
use questdb::ingress::TimestampNanos;
let ts = TimestampNanos::new(1659548315647406592);
or
use questdb::ingress::TimestampNanos;
let ts = TimestampNanos::from_systemtime(std::time::SystemTime::now())?;
or
use questdb::ingress::TimestampNanos;
let ts = TimestampNanos::from_datetime(chrono::Utc::now());
Implementations§
source§impl TimestampNanos
impl TimestampNanos
sourcepub fn new(nanos: i64) -> Self
pub fn new(nanos: i64) -> Self
Create a new timestamp from the given number of nanoseconds since the UNIX epoch (UTC).
pub fn from_systemtime(time: SystemTime) -> Result<Self>
Trait Implementations§
source§impl Clone for TimestampNanos
impl Clone for TimestampNanos
source§fn clone(&self) -> TimestampNanos
fn clone(&self) -> TimestampNanos
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TimestampNanos
impl Debug for TimestampNanos
source§impl From<TimestampNanos> for Timestamp
impl From<TimestampNanos> for Timestamp
source§fn from(ts: TimestampNanos) -> Self
fn from(ts: TimestampNanos) -> Self
Converts to this type from the input type.
source§impl From<TimestampNanos> for TimestampMicros
impl From<TimestampNanos> for TimestampMicros
source§fn from(ts: TimestampNanos) -> Self
fn from(ts: TimestampNanos) -> Self
Converts to this type from the input type.
source§impl TryFrom<Timestamp> for TimestampNanos
impl TryFrom<Timestamp> for TimestampNanos
source§impl TryFrom<TimestampMicros> for TimestampNanos
impl TryFrom<TimestampMicros> for TimestampNanos
impl Copy for TimestampNanos
Auto Trait Implementations§
impl RefUnwindSafe for TimestampNanos
impl Send for TimestampNanos
impl Sync for TimestampNanos
impl Unpin for TimestampNanos
impl UnwindSafe for TimestampNanos
Blanket Implementations§
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