#[repr(transparent)]pub struct TimestampNs(pub u64);Expand description
Timestamp in nanoseconds.
Tuple Fields§
§0: u64Implementations§
Source§impl TimestampNs
impl TimestampNs
pub const ZERO: Self
Sourcepub const fn from_nanos(nanos: u64) -> Self
pub const fn from_nanos(nanos: u64) -> Self
Create a timestamp from raw nanoseconds.
Sourcepub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_add(self, rhs: Self) -> Self
Saturating addition with another timestamp-like nanosecond delta.
Sourcepub const fn saturating_add_u64(self, rhs: u64) -> Self
pub const fn saturating_add_u64(self, rhs: u64) -> Self
Saturating addition with a raw nanosecond delta.
Sourcepub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
Saturating subtraction with another timestamp-like nanosecond value.
Trait Implementations§
Source§impl BorshDeserialize for TimestampNs
impl BorshDeserialize for TimestampNs
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSchema for TimestampNs
impl BorshSchema for TimestampNs
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
Source§impl BorshSerialize for TimestampNs
impl BorshSerialize for TimestampNs
Source§impl Clone for TimestampNs
impl Clone for TimestampNs
Source§fn clone(&self) -> TimestampNs
fn clone(&self) -> TimestampNs
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 TimestampNs
impl Debug for TimestampNs
Source§impl Default for TimestampNs
impl Default for TimestampNs
Source§fn default() -> TimestampNs
fn default() -> TimestampNs
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TimestampNs
impl<'de> Deserialize<'de> for TimestampNs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TimestampNs
impl Display for TimestampNs
Source§impl From<TimestampNs> for u64
impl From<TimestampNs> for u64
Source§fn from(value: TimestampNs) -> Self
fn from(value: TimestampNs) -> Self
Converts to this type from the input type.
Source§impl From<u64> for TimestampNs
impl From<u64> for TimestampNs
Source§impl Hash for TimestampNs
impl Hash for TimestampNs
Source§impl JsonSchema for TimestampNs
impl JsonSchema for TimestampNs
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for TimestampNs
impl Ord for TimestampNs
Source§fn cmp(&self, other: &TimestampNs) -> Ordering
fn cmp(&self, other: &TimestampNs) -> Ordering
1.21.0 · 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
Source§impl PartialEq for TimestampNs
impl PartialEq for TimestampNs
Source§impl PartialOrd for TimestampNs
impl PartialOrd for TimestampNs
Source§impl Serialize for TimestampNs
impl Serialize for TimestampNs
impl Copy for TimestampNs
impl Eq for TimestampNs
impl StructuralPartialEq for TimestampNs
Auto Trait Implementations§
impl Freeze for TimestampNs
impl RefUnwindSafe for TimestampNs
impl Send for TimestampNs
impl Sync for TimestampNs
impl Unpin for TimestampNs
impl UnwindSafe for TimestampNs
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