pub struct TransactionSlot(/* private fields */);Expand description
The type of transaction slot could be either explicit slot address or output index.
A payload declares its outputs upfront, and every #[output] and return value of a method
writes one of them, see TransactionOutput. If Self::slot_type() returns
TransactionSlotType::OutputIndex, then the slot is the value that an earlier method wrote
last into the declared output with output_index, 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 below MAX_OUTPUTS.
Sourcepub const fn from_u8(n: u8) -> Option<Self>
pub const fn from_u8(n: u8) -> Option<Self>
Create an instance from u8.
Returns None for bytes that Self::into_u8() never returns, so each slot has one
encoding.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl 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 UnsafeUnpin 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
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