pub struct Clock {
pub id: UID,
pub timestamp_ms: u64,
}
Expand description
Singleton shared object that exposes time to Move calls. This object is found at address 0x6, and can only be read (accessed via an immutable reference) by entry functions.
Entry Functions that attempt to accept Clock
by mutable
reference or value will fail to verify, and honest validators
will not sign or execute transactions that use Clock
as an
input parameter, unless it is passed by immutable reference.
Fields§
§id: UID
§timestamp_ms: u64
The clock’s timestamp, which is set automatically by a
system transaction every time consensus commits a
schedule, or by sui::clock::increment_for_testing
during
testing.
Implementations§
Source§impl Clock
impl Clock
pub fn move_instance(self) -> MoveInstance<Self>
pub fn type_() -> ClockTypeTag
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Clock
impl<'de> Deserialize<'de> for Clock
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 MoveStruct for Clock
impl MoveStruct for Clock
type StructTag = ClockTypeTag
Source§impl MoveType for Clock
impl MoveType for Clock
Source§impl StaticModule for Clock
impl StaticModule for Clock
fn module() -> Identifier
Source§impl StaticName for Clock
impl StaticName for Clock
fn name() -> Identifier
Source§impl StaticTypeParams for Clock
impl StaticTypeParams for Clock
fn type_params() -> Vec<TypeTag>
impl Eq for Clock
impl StructuralPartialEq for Clock
Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnwindSafe for Clock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more