pub trait Bolt12InvoiceExt: Borrow<Bolt12Invoice> {
// Provided methods
fn payment_hash(&self) -> PaymentHash { ... }
fn get_final_amount(
&self,
user_amount: Option<Amount>,
) -> Result<Amount, CheckAmountError> { ... }
fn check_signature(&self) -> Result<(), CheckSignatureError> { ... }
fn bytes(&self) -> Vec<u8> ⓘ { ... }
fn from_bytes(bytes: &[u8]) -> Result<Bolt12Invoice, Bolt12ParseError> { ... }
fn validate_issuance(
&self,
offer: &Offer,
) -> Result<(), CheckSignatureError> { ... }
fn from_str(s: &str) -> Result<Bolt12Invoice, Bolt12ParseError> { ... }
}Expand description
Extension trait for the Bolt12Invoice type
Provided Methods§
fn payment_hash(&self) -> PaymentHash
Sourcefn get_final_amount(
&self,
user_amount: Option<Amount>,
) -> Result<Amount, CheckAmountError>
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.
fn check_signature(&self) -> Result<(), CheckSignatureError>
fn bytes(&self) -> Vec<u8> ⓘ
fn from_bytes(bytes: &[u8]) -> Result<Bolt12Invoice, Bolt12ParseError>
fn validate_issuance(&self, offer: &Offer) -> Result<(), CheckSignatureError>
fn from_str(s: &str) -> Result<Bolt12Invoice, Bolt12ParseError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.