pub struct PaymentHash(/* private fields */);Expand description
The hash of a Preimage, used to identify HTLC-based payments.
Implementations§
Source§impl PaymentHash
impl PaymentHash
Sourcepub fn to_byte_array(self) -> [u8; 32]
pub fn to_byte_array(self) -> [u8; 32]
Convert into underlying byte array.
Sourcepub fn from_byte_array(bytes: [u8; 32]) -> Self
pub fn from_byte_array(bytes: [u8; 32]) -> Self
Convert from byte array.
Sourcepub fn from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
pub fn from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
Create from byte slice.
Source§impl PaymentHash
impl PaymentHash
Sourcepub fn to_sha256_hash(&self) -> Hash
pub fn to_sha256_hash(&self) -> Hash
Converts this PaymentHash into a bitcoin::hashes::sha256::Hash.
Trait Implementations§
Source§impl AsRef<[u8]> for PaymentHash
impl AsRef<[u8]> for PaymentHash
Source§impl Clone for PaymentHash
impl Clone for PaymentHash
Source§fn clone(&self) -> PaymentHash
fn clone(&self) -> PaymentHash
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 PaymentHash
impl Debug for PaymentHash
Source§impl<'de> Deserialize<'de> for PaymentHash
impl<'de> Deserialize<'de> for PaymentHash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PaymentHash
impl Display for PaymentHash
Source§impl<'a> DisplayHex for &'a PaymentHash
impl<'a> DisplayHex for &'a PaymentHash
Source§type Display = <&'a [u8; 32] as DisplayHex>::Display
type Display = <&'a [u8; 32] as DisplayHex>::Display
The type providing
fmt::Display implementation. Read moreSource§fn to_lower_hex_string(self) -> String
fn to_lower_hex_string(self) -> String
Create a lower-hex-encoded string. Read more
Source§fn to_upper_hex_string(self) -> String
fn to_upper_hex_string(self) -> String
Create an upper-hex-encoded string. Read more
Source§fn append_hex_to_string(self, case: Case, string: &mut String)
fn append_hex_to_string(self, case: Case, string: &mut String)
Appends hex-encoded content to an existing
String. Read moreSource§fn hex_reserve_suggestion(self) -> usize
fn hex_reserve_suggestion(self) -> usize
Hints how much bytes to reserve when creating a
String. Read moreSource§impl<'a> From<&'a Bolt11Invoice> for PaymentHash
impl<'a> From<&'a Bolt11Invoice> for PaymentHash
Source§fn from(i: &'a Bolt11Invoice) -> Self
fn from(i: &'a Bolt11Invoice) -> Self
Converts to this type from the input type.
Source§impl From<Bolt11Invoice> for PaymentHash
impl From<Bolt11Invoice> for PaymentHash
Source§fn from(i: Bolt11Invoice) -> Self
fn from(i: Bolt11Invoice) -> Self
Converts to this type from the input type.
Source§impl From<Hash> for PaymentHash
impl From<Hash> for PaymentHash
Source§impl From<PaymentHash> for [u8; 32]
impl From<PaymentHash> for [u8; 32]
Source§fn from(p: PaymentHash) -> Self
fn from(p: PaymentHash) -> Self
Converts to this type from the input type.
Source§impl From<PaymentHash> for PaymentHash
impl From<PaymentHash> for PaymentHash
Source§fn from(hash: PaymentHash) -> Self
fn from(hash: PaymentHash) -> Self
Converts to this type from the input type.
Source§impl From<Preimage> for PaymentHash
impl From<Preimage> for PaymentHash
Source§impl FromStr for PaymentHash
impl FromStr for PaymentHash
Source§impl Hash for PaymentHash
impl Hash for PaymentHash
Source§impl Ord for PaymentHash
impl Ord for PaymentHash
Source§fn cmp(&self, other: &PaymentHash) -> Ordering
fn cmp(&self, other: &PaymentHash) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PaymentHash
impl PartialEq for PaymentHash
Source§impl PartialOrd for PaymentHash
impl PartialOrd for PaymentHash
Source§impl Serialize for PaymentHash
impl Serialize for PaymentHash
Source§impl TryFrom<&[u8]> for PaymentHash
impl TryFrom<&[u8]> for PaymentHash
impl Copy for PaymentHash
impl Eq for PaymentHash
impl StructuralPartialEq for PaymentHash
Auto Trait Implementations§
impl Freeze for PaymentHash
impl RefUnwindSafe for PaymentHash
impl Send for PaymentHash
impl Sync for PaymentHash
impl Unpin for PaymentHash
impl UnwindSafe for PaymentHash
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