pub struct TransactionSlot(/* private fields */);
Expand description
The type of transaction slot could be either explicit slot address or output index.
Specifically, if the previous method has #[output]
or return value, those values are collected
and pushed into a virtual “stack”. Then, if Self::slot_type()
returns
TransactionSlotType::OutputIndex
, then the corresponding input will use the value at
output_index
of this stack instead of what was specified in external_args
. This allows
composing calls to multiple methods into more sophisticated workflows without writing special
contracts for this.
Implementations§
Source§impl TransactionSlot
impl TransactionSlot
Sourcepub const fn new_address() -> Self
pub const fn new_address() -> Self
Explicit slot address
Sourcepub const fn new_output_index(output_index: u8) -> Option<Self>
pub const fn new_output_index(output_index: u8) -> Option<Self>
Output index value.
Valid index values are 0..=127.
Sourcepub const fn slot_type(self) -> TransactionSlotType
pub const fn slot_type(self) -> TransactionSlotType
Returns Some(output_index)
or None
if explicit slot address
Trait Implementations§
Source§impl Clone for TransactionSlot
impl Clone for TransactionSlot
Source§fn clone(&self) -> TransactionSlot
fn clone(&self) -> TransactionSlot
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TransactionSlot
impl Debug for TransactionSlot
impl Copy for TransactionSlot
Auto Trait Implementations§
impl Freeze for TransactionSlot
impl RefUnwindSafe for TransactionSlot
impl Send for TransactionSlot
impl Sync for TransactionSlot
impl Unpin for TransactionSlot
impl UnwindSafe for TransactionSlot
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