pub struct TransactionInput(/* private fields */);Expand description
The type of transaction input could be either explicit value 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::input_type() returns
TransactionInputType::OutputIndex, then the input 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 TransactionInput
impl TransactionInput
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 input has one
encoding.
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
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 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 UnsafeUnpin 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
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