Struct tcgeneric::NetworkTime
source · [−]pub struct NetworkTime { /* private fields */ }
Expand description
The current time of the TinyChain network, used to generate transaction IDs.
Implementations
sourceimpl NetworkTime
impl NetworkTime
A TinyChain timestamp, used for absolute ordering of transactions.
sourcepub fn now() -> NetworkTime
pub fn now() -> NetworkTime
The current time.
sourcepub fn from_nanos(nanos: u64) -> NetworkTime
pub fn from_nanos(nanos: u64) -> NetworkTime
Constructs a new timestamp from a duration in nanoseconds since the Unix epoch.
Trait Implementations
sourceimpl Add<&'_ NetworkTime> for Duration
impl Add<&'_ NetworkTime> for Duration
type Output = NetworkTime
type Output = NetworkTime
The resulting type after applying the +
operator.
sourcefn add(self, other: &NetworkTime) -> NetworkTime
fn add(self, other: &NetworkTime) -> NetworkTime
Performs the +
operation. Read more
sourceimpl Add<Duration> for NetworkTime
impl Add<Duration> for NetworkTime
sourceimpl<'a> Add<Duration> for &'a NetworkTime
impl<'a> Add<Duration> for &'a NetworkTime
type Output = NetworkTime
type Output = NetworkTime
The resulting type after applying the +
operator.
sourcefn add(self, other: Duration) -> NetworkTime
fn add(self, other: Duration) -> NetworkTime
Performs the +
operation. Read more
sourceimpl Clone for NetworkTime
impl Clone for NetworkTime
sourcefn clone(&self) -> NetworkTime
fn clone(&self) -> NetworkTime
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<NetworkTime> for SystemTime
impl From<NetworkTime> for SystemTime
sourcefn from(nt: NetworkTime) -> Self
fn from(nt: NetworkTime) -> Self
Converts to this type from the input type.
sourceimpl Ord for NetworkTime
impl Ord for NetworkTime
sourceimpl PartialEq<NetworkTime> for NetworkTime
impl PartialEq<NetworkTime> for NetworkTime
sourcefn eq(&self, other: &NetworkTime) -> bool
fn eq(&self, other: &NetworkTime) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NetworkTime) -> bool
fn ne(&self, other: &NetworkTime) -> bool
This method tests for !=
.
sourceimpl PartialOrd<NetworkTime> for NetworkTime
impl PartialOrd<NetworkTime> for NetworkTime
sourcefn partial_cmp(&self, other: &NetworkTime) -> Option<Ordering>
fn partial_cmp(&self, other: &NetworkTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl TryFrom<SystemTime> for NetworkTime
impl TryFrom<SystemTime> for NetworkTime
sourcefn try_from(st: SystemTime) -> TCResult<NetworkTime>
fn try_from(st: SystemTime) -> TCResult<NetworkTime>
Performs the conversion.
impl Eq for NetworkTime
impl StructuralEq for NetworkTime
impl StructuralPartialEq for NetworkTime
Auto Trait Implementations
impl RefUnwindSafe for NetworkTime
impl Send for NetworkTime
impl Sync for NetworkTime
impl Unpin for NetworkTime
impl UnwindSafe for NetworkTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.