pub struct NanoTimeStamp(pub u64);
Tuple Fields§
§0: u64
Implementations§
Source§impl NanoTimeStamp
impl NanoTimeStamp
pub const NS_PER_SECOND: u64 = 1_000_000_000u64
pub const NS_PER_MINUTE: u64 = 60_000_000_000u64
pub const NS_PER_HOUR: u64 = 3_600_000_000_000u64
pub const NS_PER_DAY: u64 = 86_400_000_000_000u64
pub fn days_from_now(days: u64) -> Self
Sourcepub fn has_passed(&self) -> bool
pub fn has_passed(&self) -> bool
Checks if the deadline has passed
Sourcepub fn time_until(&self) -> u64
pub fn time_until(&self) -> u64
Returns the amount of time remaining until the deadline Returns 0 if the deadline has passed
Sourcepub fn time_since(&self) -> u64
pub fn time_since(&self) -> u64
Returns the amount of time that has passed since the deadline Returns 0 if the deadline is still in the future
Sourcepub fn rate_limit_exceeded(&self, rate_limit: u64) -> bool
pub fn rate_limit_exceeded(&self, rate_limit: u64) -> bool
check if the rate limit has been exceeded returns true if the rate limit has been exceeded
Trait Implementations§
Source§impl CandidType for NanoTimeStamp
impl CandidType for NanoTimeStamp
Source§impl Clone for NanoTimeStamp
impl Clone for NanoTimeStamp
Source§fn clone(&self) -> NanoTimeStamp
fn clone(&self) -> NanoTimeStamp
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NanoTimeStamp
impl Debug for NanoTimeStamp
Source§impl<'de> Deserialize<'de> for NanoTimeStamp
impl<'de> Deserialize<'de> for NanoTimeStamp
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 Ord for NanoTimeStamp
impl Ord for NanoTimeStamp
Source§fn cmp(&self, other: &NanoTimeStamp) -> Ordering
fn cmp(&self, other: &NanoTimeStamp) -> 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 NanoTimeStamp
impl PartialEq for NanoTimeStamp
Source§impl PartialOrd for NanoTimeStamp
impl PartialOrd for NanoTimeStamp
Source§impl Serialize for NanoTimeStamp
impl Serialize for NanoTimeStamp
impl Eq for NanoTimeStamp
impl StructuralPartialEq for NanoTimeStamp
Auto Trait Implementations§
impl Freeze for NanoTimeStamp
impl RefUnwindSafe for NanoTimeStamp
impl Send for NanoTimeStamp
impl Sync for NanoTimeStamp
impl Unpin for NanoTimeStamp
impl UnwindSafe for NanoTimeStamp
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