pub struct Transaction<'a> {
pub header: &'a TransactionHeader,
pub read_slots: &'a [TransactionSlot],
pub write_slots: &'a [TransactionSlot],
pub payload: &'a [u128],
pub seal: &'a [u8],
}
Expand description
Similar to Transaction
, but doesn’t require allow
or data ownership.
Can be created with Transaction::as_ref()
call.
Fields§
§header: &'a TransactionHeader
Transaction header
read_slots: &'a [TransactionSlot]
Slots in the form of TransactionSlot
that may be read during transaction processing.
These are the only slots that can be used in authorization code.
The code slot of the contract that is being executed and balance of native token are
implicitly included and doesn’t need to be specified (see Transaction::read_slots()
.
Also slots that may also be written to do not need to be repeated in the read slots.
write_slots: &'a [TransactionSlot]
Slots in the form of TransactionSlot
that may be written during transaction processing
payload: &'a [u128]
Transaction payload
seal: &'a [u8]
Transaction seal
Implementations§
Source§impl Transaction<'_>
impl Transaction<'_>
Sourcepub fn hash(&self) -> TransactionHash
pub fn hash(&self) -> TransactionHash
Compute transaction hash.
Note: this computes transaction hash on every call, so worth caching if it is expected to be called often.
Sourcepub fn read_slots(&self) -> impl Iterator<Item = TransactionSlot>
pub fn read_slots(&self) -> impl Iterator<Item = TransactionSlot>
Read slots touched by the transaction.
In contrast to read_slots
property, this includes implicitly used slots.
Sourcepub fn slots(&self) -> impl Iterator<Item = TransactionSlot>
pub fn slots(&self) -> impl Iterator<Item = TransactionSlot>
All slots touched by the transaction.
In contrast to read_slots
and write_slots
properties, this includes implicitly used
slots.
Trait Implementations§
Source§impl<'a> Clone for Transaction<'a>
impl<'a> Clone for Transaction<'a>
Source§fn clone(&self) -> Transaction<'a>
fn clone(&self) -> Transaction<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for Transaction<'a>
impl<'a> Debug for Transaction<'a>
impl<'a> Copy for Transaction<'a>
Auto Trait Implementations§
impl<'a> Freeze for Transaction<'a>
impl<'a> RefUnwindSafe for Transaction<'a>
impl<'a> Send for Transaction<'a>
impl<'a> Sync for Transaction<'a>
impl<'a> Unpin for Transaction<'a>
impl<'a> UnwindSafe for Transaction<'a>
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
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>
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>
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