pub struct PaymentRequest {
pub mint: PublicKey,
pub outputs: Vec<Output>,
}Expand description
What a payee asks to be paid: one fresh key of its own for each note it expects, so the mint never sees two of its notes under one key.
Make one with Holder::request and hand it to
the payer, who answers with a Payment.
Fields§
§mint: PublicKeyThe mint whose notes the payee accepts.
outputs: Vec<Output>The notes to be created for the payee: an amount and a fresh key each.
Implementations§
Source§impl PaymentRequest
impl PaymentRequest
Sourcepub fn check(&self, payment: &Payment) -> Result<(), CheckError>
pub fn check(&self, payment: &Payment) -> Result<(), CheckError>
Checks that a payment pays exactly what this request asks: every transfer spends one note of the requested mint, and every requested output appears in exactly one transfer.
It cannot tell whether the payer’s notes are still live; submitting the transfers does.
Trait Implementations§
Source§impl Clone for PaymentRequest
impl Clone for PaymentRequest
Source§fn clone(&self) -> PaymentRequest
fn clone(&self) -> PaymentRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PaymentRequest
impl Debug for PaymentRequest
Source§impl<'de> Deserialize<'de> for PaymentRequest
impl<'de> Deserialize<'de> for PaymentRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PaymentRequest
Source§impl PartialEq for PaymentRequest
impl PartialEq for PaymentRequest
Source§impl Serialize for PaymentRequest
impl Serialize for PaymentRequest
impl StructuralPartialEq for PaymentRequest
Auto Trait Implementations§
impl Freeze for PaymentRequest
impl RefUnwindSafe for PaymentRequest
impl Send for PaymentRequest
impl Sync for PaymentRequest
impl Unpin for PaymentRequest
impl UnsafeUnpin for PaymentRequest
impl UnwindSafe for PaymentRequest
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