TransferBuilder

Struct TransferBuilder 

Source
pub struct TransferBuilder { /* private fields */ }
Expand description

Builder for creating Transfer objects in a more idiomatic way

Implementations§

Source§

impl TransferBuilder

Source

pub fn asset(self, asset: AssetId) -> Self

Set the asset for this transfer

Source

pub fn originator(self, originator: Party) -> Self

Set the originator for this transfer

Source

pub fn amount(self, amount: String) -> Self

Set the amount for this transfer

Source

pub fn beneficiary(self, beneficiary: Party) -> Self

Set the beneficiary for this transfer

Source

pub fn settlement_id(self, settlement_id: String) -> Self

Set the settlement ID for this transfer

Source

pub fn memo(self, memo: String) -> Self

Set the memo for this transfer

Source

pub fn transaction_id(self, transaction_id: String) -> Self

Set the transaction ID for this transfer

Source

pub fn add_agent(self, agent: Agent) -> Self

Add an agent to this transfer

Source

pub fn agents(self, agents: Vec<Agent>) -> Self

Set all agents for this transfer

Source

pub fn add_metadata(self, key: String, value: Value) -> Self

Add a metadata field

Source

pub fn metadata(self, metadata: HashMap<String, Value>) -> Self

Set all metadata for this transfer

Source

pub fn build(self) -> Transfer

Build the Transfer object

§Panics

Panics if required fields (asset, amount) are not set

Source

pub fn try_build(self) -> Result<Transfer>

Try to build the Transfer object, returning an error if required fields are missing

Trait Implementations§

Source§

impl Default for TransferBuilder

Source§

fn default() -> TransferBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V