pub struct Bolt11Invoice { /* private fields */ }Expand description
A parsed BOLT11 invoice.
Implementations§
Source§impl Bolt11Invoice
impl Bolt11Invoice
Sourcepub fn parse(invoice: &str) -> Result<Self, LightningError>
pub fn parse(invoice: &str) -> Result<Self, LightningError>
Parse a BOLT11 invoice string.
Note: This is a simplified parser that extracts basic information. For full BOLT11 compliance, consider using a dedicated library.
Sourcepub fn amount_msat(&self) -> Option<u64>
pub fn amount_msat(&self) -> Option<u64>
Get the amount in millisatoshis.
Sourcepub fn payment_hash(&self) -> Option<&PaymentHash>
pub fn payment_hash(&self) -> Option<&PaymentHash>
Get the payment hash.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the description.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the invoice has expired.
Sourcepub fn data(&self) -> &InvoiceData
pub fn data(&self) -> &InvoiceData
Get the invoice data.
Trait Implementations§
Source§impl Clone for Bolt11Invoice
impl Clone for Bolt11Invoice
Source§fn clone(&self) -> Bolt11Invoice
fn clone(&self) -> Bolt11Invoice
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for Bolt11Invoice
impl RefUnwindSafe for Bolt11Invoice
impl Send for Bolt11Invoice
impl Sync for Bolt11Invoice
impl Unpin for Bolt11Invoice
impl UnwindSafe for Bolt11Invoice
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