pub struct Payment { /* private fields */ }
Expand description
A single payment being requested.
Implementations§
Source§impl Payment
impl Payment
Sourcepub fn new(
recipient_address: ZcashAddress,
amount: Zatoshis,
memo: Option<MemoBytes>,
label: Option<String>,
message: Option<String>,
other_params: Vec<(String, String)>,
) -> Option<Self>
pub fn new( recipient_address: ZcashAddress, amount: Zatoshis, memo: Option<MemoBytes>, label: Option<String>, message: Option<String>, other_params: Vec<(String, String)>, ) -> Option<Self>
Constructs a new Payment
from its constituent parts.
Returns None
if the payment requests that a memo be sent to a recipient that cannot
receive a memo.
Sourcepub fn without_memo(recipient_address: ZcashAddress, amount: Zatoshis) -> Self
pub fn without_memo(recipient_address: ZcashAddress, amount: Zatoshis) -> Self
Constructs a new Payment
paying the given address the specified amount.
Sourcepub fn recipient_address(&self) -> &ZcashAddress
pub fn recipient_address(&self) -> &ZcashAddress
Returns the payment address to which the payment should be sent.
Sourcepub fn amount(&self) -> Zatoshis
pub fn amount(&self) -> Zatoshis
Returns the value of the payment that is being requested, in zatoshis.
Sourcepub fn memo(&self) -> Option<&MemoBytes>
pub fn memo(&self) -> Option<&MemoBytes>
Returns the memo that, if included, must be provided with the payment.
Sourcepub fn label(&self) -> Option<&String>
pub fn label(&self) -> Option<&String>
A human-readable label for this payment within the larger structure of the transaction request.
Sourcepub fn message(&self) -> Option<&String>
pub fn message(&self) -> Option<&String>
A human-readable message to be displayed to the user describing the purpose of this payment.
Sourcepub fn other_params(&self) -> &[(String, String)]
pub fn other_params(&self) -> &[(String, String)]
A list of other arbitrary key/value pairs associated with this payment.
Trait Implementations§
impl Eq for Payment
impl StructuralPartialEq for Payment
Auto Trait Implementations§
impl Freeze for Payment
impl RefUnwindSafe for Payment
impl Send for Payment
impl Sync for Payment
impl Unpin for Payment
impl UnwindSafe for Payment
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