pub struct TransactionInput(/* private fields */);
Expand description
The type of transaction input could be either explicit value 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::input_type()
returns
TransactionInputType::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 TransactionInput
impl TransactionInput
Sourcepub const fn new_value(alignment: NonZeroU8) -> Option<Self>
pub const fn new_value(alignment: NonZeroU8) -> Option<Self>
Regular input value with specified alignment.
Valid alignment values are: 1, 2, 4, 8, 16.
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 input_type(self) -> TransactionInputType
pub const fn input_type(self) -> TransactionInputType
Returns Some(output_index)
or None
if regular input value
Trait Implementations§
Source§impl Clone for TransactionInput
impl Clone for TransactionInput
Source§fn clone(&self) -> TransactionInput
fn clone(&self) -> TransactionInput
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 TransactionInput
impl Debug for TransactionInput
impl Copy for TransactionInput
Auto Trait Implementations§
impl Freeze for TransactionInput
impl RefUnwindSafe for TransactionInput
impl Send for TransactionInput
impl Sync for TransactionInput
impl Unpin for TransactionInput
impl UnwindSafe for TransactionInput
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