pub struct TxContext {
pub sender: Address,
pub tx_hash: MoveVec<u8>,
pub epoch: u64,
pub epoch_timestamp_ms: u64,
pub ids_created: u64,
}
Expand description
Information about the transaction currently being executed.
This cannot be constructed by a transaction–it is a privileged object created by
the VM and passed in to the entrypoint of the transaction as &mut TxContext
.
Fields§
§sender: Address
The address of the user that signed the current transaction
tx_hash: MoveVec<u8>
Hash of the current transaction
epoch: u64
The current epoch number
epoch_timestamp_ms: u64
Timestamp that the epoch started at
ids_created: u64
Counter recording the number of fresh id’s created while executing this transaction. Always 0 at the start of a transaction
Implementations§
Source§impl TxContext
impl TxContext
pub fn move_instance(self) -> MoveInstance<Self>
pub fn type_() -> TxContextTypeTag
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TxContext
impl<'de> Deserialize<'de> for TxContext
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 TxContext
impl MoveStruct for TxContext
type StructTag = TxContextTypeTag
Source§impl MoveType for TxContext
impl MoveType for TxContext
Source§impl StaticModule for TxContext
impl StaticModule for TxContext
fn module() -> Identifier
Source§impl StaticName for TxContext
impl StaticName for TxContext
fn name() -> Identifier
Source§impl StaticTypeParams for TxContext
impl StaticTypeParams for TxContext
fn type_params() -> Vec<TypeTag>
impl Eq for TxContext
impl StructuralPartialEq for TxContext
Auto Trait Implementations§
impl Freeze for TxContext
impl RefUnwindSafe for TxContext
impl Send for TxContext
impl Sync for TxContext
impl Unpin for TxContext
impl UnwindSafe for TxContext
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