Struct lightning_invoice::SignedRawInvoice [−][src]
pub struct SignedRawInvoice { /* fields omitted */ }
Expand description
Represents a signed RawInvoice
with cached hash. The signature is not checked and may be
invalid.
Invariants
The hash has to be either from the deserialized invoice or from the serialized raw_invoice
.
Implementations
Disassembles the SignedRawInvoice
into its three parts:
- raw invoice
- hash of the raw invoice
- signature
The RawInvoice
which was signed.
InvoiceSignature for the invoice.
Recovers the public key used for signing the invoice from the recoverable signature.
Checks if the signature is valid for the included payee public key or if none exists if it’s valid for the recovered signature (which should always be true?).
Methods from Deref<Target = RawInvoice>
pub fn known_tagged_fields(
&self
) -> FilterMap<Iter<'_, RawTaggedField>, fn(_: &RawTaggedField) -> Option<&TaggedField>>
pub fn known_tagged_fields(
&self
) -> FilterMap<Iter<'_, RawTaggedField>, fn(_: &RawTaggedField) -> Option<&TaggedField>>
Returns an iterator over all tagged fields with known semantics.
(C-not exported) As there is not yet a manual mapping for a FilterMap
(C-not exported) as we don’t support Vec<&NonOpaqueType>
Trait Implementations
type Target = RawInvoice
type Target = RawInvoice
The resulting type after dereferencing.
Dereferences the value.
use lightning_invoice::*; let invoice = "lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\ l2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\ 3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\ ky03ylcqca784w"; let parsed_1 = invoice.parse::<Invoice>(); let parsed_2 = match invoice.parse::<SignedRawInvoice>() { Ok(signed) => match Invoice::from_signed(signed) { Ok(invoice) => Ok(invoice), Err(e) => Err(ParseOrSemanticError::SemanticError(e)), }, Err(e) => Err(ParseOrSemanticError::ParseError(e)), }; assert!(parsed_1.is_ok()); assert_eq!(parsed_1, parsed_2);
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for SignedRawInvoice
impl Send for SignedRawInvoice
impl Sync for SignedRawInvoice
impl Unpin for SignedRawInvoice
impl UnwindSafe for SignedRawInvoice
Blanket Implementations
Mutably borrows from an owned value. Read more