pub enum Invoice {
Bolt11(Bolt11Invoice),
Bolt12(Bolt12Invoice),
}Expand description
Enum to represent either a lightning Bolt11Invoice or a Bolt12Invoice.
Variants§
Bolt11(Bolt11Invoice)
Bolt12(Bolt12Invoice)
Implementations§
Source§impl Invoice
impl Invoice
pub fn into_bolt11(self) -> Option<Bolt11Invoice>
pub fn payment_hash(&self) -> PaymentHash
pub fn network(&self) -> Network
Sourcepub fn get_final_amount(
&self,
user_amount: Option<Amount>,
) -> Result<Amount, CheckAmountError>
pub fn get_final_amount( &self, user_amount: Option<Amount>, ) -> Result<Amount, CheckAmountError>
Get the amount to be paid. It checks both user and invoice equality if both are provided, else it tries to return one of them, or returns an error if neither are provided.
pub fn amount_msat(&self) -> Option<u64>
pub fn check_signature(&self) -> Result<(), CheckSignatureError>
Trait Implementations§
Source§impl AsPaymentHash for Invoice
impl AsPaymentHash for Invoice
Source§fn as_payment_hash(&self) -> PaymentHash
fn as_payment_hash(&self) -> PaymentHash
Get the payment hash associated with this item
Source§impl<'de> Deserialize<'de> for Invoice
impl<'de> Deserialize<'de> for Invoice
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Bolt11Invoice> for Invoice
impl From<Bolt11Invoice> for Invoice
Source§fn from(invoice: Bolt11Invoice) -> Self
fn from(invoice: Bolt11Invoice) -> Self
Converts to this type from the input type.
Source§impl From<Bolt12Invoice> for Invoice
impl From<Bolt12Invoice> for Invoice
Source§fn from(invoice: Bolt12Invoice) -> Self
fn from(invoice: Bolt12Invoice) -> Self
Converts to this type from the input type.
impl Eq for Invoice
impl StructuralPartialEq for Invoice
Auto Trait Implementations§
impl Freeze for Invoice
impl RefUnwindSafe for Invoice
impl Send for Invoice
impl Sync for Invoice
impl Unpin for Invoice
impl UnsafeUnpin for Invoice
impl UnwindSafe for Invoice
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