pub struct TransactionOutputBuilder { /* private fields */ }
Expand description
We introduce a builder-pattern format for creating transaction outputs This is because:
- Some fields (i.e. data hash) are optional, and we can’t easily expose Option<> in WASM
- Some fields like amounts have many ways it could be set (some depending on other field values being known)
- Easier to adapt as the output format gets more complicated in future Cardano releases
Implementations§
Source§impl TransactionOutputBuilder
impl TransactionOutputBuilder
pub fn new() -> Self
pub fn with_address(&self, address: &Address) -> Self
pub fn with_data_hash(&self, data_hash: &DataHash) -> Self
pub fn with_plutus_data(&self, data: &PlutusData) -> Self
pub fn with_script_ref(&self, script_ref: &ScriptRef) -> Self
pub fn next(&self) -> Result<TransactionOutputAmountBuilder, JsError>
Trait Implementations§
Source§impl Clone for TransactionOutputBuilder
impl Clone for TransactionOutputBuilder
Source§fn clone(&self) -> TransactionOutputBuilder
fn clone(&self) -> TransactionOutputBuilder
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 moreAuto Trait Implementations§
impl Freeze for TransactionOutputBuilder
impl RefUnwindSafe for TransactionOutputBuilder
impl Send for TransactionOutputBuilder
impl Sync for TransactionOutputBuilder
impl Unpin for TransactionOutputBuilder
impl UnwindSafe for TransactionOutputBuilder
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
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>
Converts
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>
Converts
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