pub struct SignedRawInvoice { /* fields omitted */ }
Represents a signed RawInvoice
with cached hash. The signature is not checked and may be
invalid.
The hash has to be either from the deserialized invoice or from the serialized raw_invoice
.
Disassembles the SignedRawInvoice
into its three parts:
- raw invoice
- hash of the raw invoice
- signature
The RawInvoice
which was signed.
The hash of the RawInvoice
that was signed.
Signature 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?).
Calculate the hash of the encoded RawInvoice
Returns an iterator over all tagged fields with known semantics.
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
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);
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
Converts the given value to a String
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static