Struct nakamoto_test::block::time::RefClock
source · pub struct RefClock<T>where
T: Clock,{ /* private fields */ }
Expand description
Clock with interior mutability.
Implementations
Trait Implementations
sourceimpl<K> AdjustedClock<K> for RefClock<AdjustedTime<K>>where
K: Eq + Clone + Hash,
impl<K> AdjustedClock<K> for RefClock<AdjustedTime<K>>where
K: Eq + Clone + Hash,
sourceimpl<T> Clock for RefClock<T>where
T: Clock,
impl<T> Clock for RefClock<T>where
T: Clock,
sourcefn block_time(&self) -> u32
fn block_time(&self) -> u32
Return the local time as seconds since Epoch.
This is the same representation as used in block header timestamps. Read more
sourcefn local_time(&self) -> LocalTime
fn local_time(&self) -> LocalTime
Tell the time in local time.
sourcefn from_block_time(t: u32) -> RefClock<T>
fn from_block_time(t: u32) -> RefClock<T>
Create a clock from a block time.
Auto Trait Implementations
impl<T> !RefUnwindSafe for RefClock<T>
impl<T> !Send for RefClock<T>
impl<T> !Sync for RefClock<T>
impl<T> Unpin for RefClock<T>
impl<T> !UnwindSafe for RefClock<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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