pub struct TransactionOutputBuilder {
pub address: Option<Address>,
pub datum: Option<DatumOption>,
pub communication_datum: Option<PlutusData>,
pub script_ref: Option<ScriptRef>,
}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
Fields§
§address: Option<Address>§datum: Option<DatumOption>§communication_datum: Option<PlutusData>§script_ref: Option<ScriptRef>Implementations§
source§impl TransactionOutputBuilder
impl TransactionOutputBuilder
pub fn new() -> Self
pub fn with_address(self, address: Address) -> Self
sourcepub fn with_communication_data(self, datum: PlutusData) -> Self
pub fn with_communication_data(self, datum: PlutusData) -> Self
A communication datum is one where the data hash is used in the tx output Yet the full datum is included in the witness of the same transaction
pub fn with_data(self, datum: DatumOption) -> Self
pub fn with_reference_script(self, script_ref: ScriptRef) -> Self
pub fn next(self) -> Result<TransactionOutputAmountBuilder, OutputBuilderError>
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 moresource§impl Debug for TransactionOutputBuilder
impl Debug for TransactionOutputBuilder
source§impl Default for TransactionOutputBuilder
impl Default for TransactionOutputBuilder
source§fn default() -> TransactionOutputBuilder
fn default() -> TransactionOutputBuilder
Returns the “default value” for a type. Read more
Auto 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> 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