[−][src]Struct lightning_invoice::SignedRawInvoice
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
impl SignedRawInvoice
[src]
pub fn into_parts(self) -> (RawInvoice, [u8; 32], Signature)
[src]
Disassembles the SignedRawInvoice
into its three parts:
- raw invoice
- hash of the raw invoice
- signature
pub fn raw_invoice(&self) -> &RawInvoice
[src]
The RawInvoice
which was signed.
pub fn hash(&self) -> &[u8; 32]
[src]
The hash of the RawInvoice
that was signed.
pub fn signature(&self) -> &Signature
[src]
Signature for the invoice.
pub fn recover_payee_pub_key(&self) -> Result<PayeePubKey, Error>
[src]
Recovers the public key used for signing the invoice from the recoverable signature.
pub fn check_signature(&self) -> bool
[src]
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 hash(&self) -> [u8; 32]
[src]
Calculate the hash of the encoded RawInvoice
pub fn known_tagged_fields(
&self
) -> FilterMap<Iter<RawTaggedField>, fn(_: &RawTaggedField) -> Option<&TaggedField>>
[src]
&self
) -> FilterMap<Iter<RawTaggedField>, fn(_: &RawTaggedField) -> Option<&TaggedField>>
Returns an iterator over all tagged fields with known semantics.
pub fn payment_hash(&self) -> Option<&Sha256>
[src]
pub fn description(&self) -> Option<&Description>
[src]
pub fn payee_pub_key(&self) -> Option<&PayeePubKey>
[src]
pub fn description_hash(&self) -> Option<&Sha256>
[src]
pub fn expiry_time(&self) -> Option<&ExpiryTime>
[src]
pub fn min_final_cltv_expiry(&self) -> Option<&MinFinalCltvExpiry>
[src]
pub fn fallbacks(&self) -> Vec<&Fallback>
[src]
pub fn routes(&self) -> Vec<&Route>
[src]
pub fn amount_pico_btc(&self) -> Option<u64>
[src]
pub fn currency(&self) -> Currency
[src]
Trait Implementations
impl Clone for SignedRawInvoice
[src]
fn clone(&self) -> SignedRawInvoice
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SignedRawInvoice
[src]
impl Deref for SignedRawInvoice
[src]
impl Display for SignedRawInvoice
[src]
impl Eq for SignedRawInvoice
[src]
impl FromStr for SignedRawInvoice
[src]
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);
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<SignedRawInvoice> for SignedRawInvoice
[src]
fn eq(&self, other: &SignedRawInvoice) -> bool
[src]
fn ne(&self, other: &SignedRawInvoice) -> bool
[src]
impl StructuralEq for SignedRawInvoice
[src]
impl StructuralPartialEq for SignedRawInvoice
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,