pub struct TransactionOutput(/* private fields */);Expand description
The type of transaction output could be either #[output] or return value, with the index of
the declared output that it writes.
A payload declares its outputs upfront, each with a capacity, and every #[output] and return
value of a method writes one of them, which later methods can refer to, see
TransactionInput. Several methods can write the same declared output one after another, and
each of them replaces the value. A method writes a declared output at most once, and its slots
and inputs don’t refer to a declared output that it writes. The memory of every declared output
is aligned to [Alignment::MAX], the largest alignment of any type that methods accept, so it
is aligned for every output type.
#[output] is given to the method empty, whatever the memory held before, and has the size the
method wrote into it. The return value doesn’t have a size in ExternalArgs, executors only
write the value, so the payload declares its size, which is the size of its type and must not
exceed the capacity of the declared output.
Implementations§
Source§impl TransactionOutput
impl TransactionOutput
Sourcepub const fn new_output(output_index: u8) -> Option<Self>
pub const fn new_output(output_index: u8) -> Option<Self>
#[output] that writes the declared output with output_index.
Valid index values are below MAX_OUTPUTS.
Sourcepub const fn new_return_value(output_index: u8) -> Option<Self>
pub const fn new_return_value(output_index: u8) -> Option<Self>
Return value that is written into the declared output with output_index.
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 output has one
encoding.
Sourcepub const fn output_type(self) -> TransactionOutputType
pub const fn output_type(self) -> TransactionOutputType
Returns whether this is #[output] or return value, with the index of its declared output
Trait Implementations§
Source§impl Clone for TransactionOutput
impl Clone for TransactionOutput
Source§fn clone(&self) -> TransactionOutput
fn clone(&self) -> TransactionOutput
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 TransactionOutput
Auto Trait Implementations§
impl Freeze for TransactionOutput
impl RefUnwindSafe for TransactionOutput
impl Send for TransactionOutput
impl Sync for TransactionOutput
impl Unpin for TransactionOutput
impl UnsafeUnpin for TransactionOutput
impl UnwindSafe for TransactionOutput
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