#[repr(transparent)]pub struct ClientPaymentId(pub [u8; 32]);Expand description
A unique, client-generated id for payment types (onchain send, ln spontaneous send) that need an extra id for idempotency.
Its primary purpose is to prevent accidental double payments. Internal structure (if any) is opaque to the node.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl ClientPaymentId
impl ClientPaymentId
Sourcepub fn generate() -> ClientPaymentId
pub fn generate() -> ClientPaymentId
Generate a random ClientPaymentId.
Trait Implementations§
Source§impl AsRef<[u8]> for ClientPaymentId
impl AsRef<[u8]> for ClientPaymentId
Source§impl ByteArray<32> for ClientPaymentId
impl ByteArray<32> for ClientPaymentId
fn from_array(array: [u8; 32]) -> ClientPaymentId
fn to_array(&self) -> [u8; 32]
fn as_array(&self) -> &[u8; 32]
fn as_slice(&self) -> &[u8] ⓘ
fn to_vec(&self) -> Vec<u8> ⓘ
fn try_from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
fn try_from_vec(vec: Vec<u8>) -> Result<Self, TryFromSliceError>
fn from_hex(s: &str) -> Result<Self, DecodeError>
fn to_hex(&self) -> String
fn as_hex_display(&self) -> HexDisplay<'_>
fn fmt_as_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl Clone for ClientPaymentId
impl Clone for ClientPaymentId
Source§fn clone(&self) -> ClientPaymentId
fn clone(&self) -> ClientPaymentId
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 ClientPaymentId
impl Debug for ClientPaymentId
Source§impl<'de> Deserialize<'de> for ClientPaymentId
impl<'de> Deserialize<'de> for ClientPaymentId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ClientPaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ClientPaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ClientPaymentId
impl Display for ClientPaymentId
Source§impl FromHex for ClientPaymentId
impl FromHex for ClientPaymentId
fn from_hex(s: &str) -> Result<ClientPaymentId, DecodeError>
Source§impl FromStr for ClientPaymentId
impl FromStr for ClientPaymentId
Source§type Err = DecodeError
type Err = DecodeError
The associated error which can be returned from parsing.
Source§fn from_str(
s: &str,
) -> Result<ClientPaymentId, <ClientPaymentId as FromStr>::Err>
fn from_str( s: &str, ) -> Result<ClientPaymentId, <ClientPaymentId as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for ClientPaymentId
impl Hash for ClientPaymentId
Source§impl Ord for ClientPaymentId
impl Ord for ClientPaymentId
Source§fn cmp(&self, other: &ClientPaymentId) -> Ordering
fn cmp(&self, other: &ClientPaymentId) -> 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 ClientPaymentId
impl PartialEq for ClientPaymentId
Source§impl PartialOrd for ClientPaymentId
impl PartialOrd for ClientPaymentId
Source§impl RefCast for ClientPaymentId
impl RefCast for ClientPaymentId
type From = [u8; 32]
fn ref_cast(_from: &<ClientPaymentId as RefCast>::From) -> &ClientPaymentId
fn ref_cast_mut( _from: &mut <ClientPaymentId as RefCast>::From, ) -> &mut ClientPaymentId
Source§impl Serialize for ClientPaymentId
impl Serialize for ClientPaymentId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<PaymentId> for ClientPaymentId
impl TryFrom<PaymentId> for ClientPaymentId
impl Copy for ClientPaymentId
impl Eq for ClientPaymentId
impl StructuralPartialEq for ClientPaymentId
Auto Trait Implementations§
impl Freeze for ClientPaymentId
impl RefUnwindSafe for ClientPaymentId
impl Send for ClientPaymentId
impl Sync for ClientPaymentId
impl Unpin for ClientPaymentId
impl UnsafeUnpin for ClientPaymentId
impl UnwindSafe for ClientPaymentId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.