pub struct PaymentPreimage(/* private fields */);Expand description
A 32-byte payment preimage.
The preimage is the secret that, when hashed with SHA256, produces the payment hash. Revealing the preimage proves that a payment was received.
Implementations§
Source§impl PaymentPreimage
impl PaymentPreimage
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Create a new payment preimage from bytes.
Sourcepub fn from_hex(hex: &str) -> Result<Self, LightningError>
pub fn from_hex(hex: &str) -> Result<Self, LightningError>
Create a new payment preimage from a hex string.
Sourcepub fn payment_hash(&self) -> PaymentHash
pub fn payment_hash(&self) -> PaymentHash
Compute the payment hash from this preimage.
Trait Implementations§
Source§impl Clone for PaymentPreimage
impl Clone for PaymentPreimage
Source§fn clone(&self) -> PaymentPreimage
fn clone(&self) -> PaymentPreimage
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 moreSource§impl Debug for PaymentPreimage
impl Debug for PaymentPreimage
Source§impl Display for PaymentPreimage
impl Display for PaymentPreimage
Source§impl PartialEq for PaymentPreimage
impl PartialEq for PaymentPreimage
impl Eq for PaymentPreimage
impl StructuralPartialEq for PaymentPreimage
Auto Trait Implementations§
impl Freeze for PaymentPreimage
impl RefUnwindSafe for PaymentPreimage
impl Send for PaymentPreimage
impl Sync for PaymentPreimage
impl Unpin for PaymentPreimage
impl UnwindSafe for PaymentPreimage
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