pub struct NetworkTimestamp(pub u64);Expand description
ネットワーク時刻。Nemesis の時刻(ネットワークのエポック)からのミリ秒。catapult の Timestamp。
トランザクションの期限やブロックの時刻は、これで書く。
Tuple Fields§
§0: u64Implementations§
Source§impl NetworkTimestamp
impl NetworkTimestamp
Sourcepub fn checked_add(self, duration: Duration) -> Option<Self>
pub fn checked_add(self, duration: Duration) -> Option<Self>
duration だけ後の時刻。ミリ秒より細かいところは切り捨てる。u64 に収まらなければ None。
Sourcepub fn checked_sub(self, duration: Duration) -> Option<Self>
pub fn checked_sub(self, duration: Duration) -> Option<Self>
duration だけ前の時刻。ミリ秒より細かいところは切り上げる(前に戻しすぎない)。エポックより前なら None。
Sourcepub fn duration_since(self, earlier: Self) -> Option<Duration>
pub fn duration_since(self, earlier: Self) -> Option<Duration>
earlier からの経過。earlier のほうが後なら None。
Trait Implementations§
Source§impl Clone for NetworkTimestamp
impl Clone for NetworkTimestamp
Source§fn clone(&self) -> NetworkTimestamp
fn clone(&self) -> NetworkTimestamp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NetworkTimestamp
Source§impl Debug for NetworkTimestamp
impl Debug for NetworkTimestamp
impl Eq for NetworkTimestamp
Source§impl Hash for NetworkTimestamp
impl Hash for NetworkTimestamp
Source§impl Ord for NetworkTimestamp
impl Ord for NetworkTimestamp
Source§fn cmp(&self, other: &NetworkTimestamp) -> Ordering
fn cmp(&self, other: &NetworkTimestamp) -> Ordering
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
Source§impl PartialEq for NetworkTimestamp
impl PartialEq for NetworkTimestamp
Source§impl PartialOrd for NetworkTimestamp
impl PartialOrd for NetworkTimestamp
impl StructuralPartialEq for NetworkTimestamp
Auto Trait Implementations§
impl Freeze for NetworkTimestamp
impl RefUnwindSafe for NetworkTimestamp
impl Send for NetworkTimestamp
impl Sync for NetworkTimestamp
impl Unpin for NetworkTimestamp
impl UnsafeUnpin for NetworkTimestamp
impl UnwindSafe for NetworkTimestamp
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