Enum PaymentId
pub enum PaymentId {
OfferRecvReusable(LnClaimId),
OfferSend(ClientPaymentId),
Lightning(PaymentHash),
OnchainRecv(Txid),
OnchainSend(ClientPaymentId),
}Expand description
A globally unique identifier for any payment (Lightning or on-chain).
Serialized as "<prefix>_<hex>", e.g. "ln_3ddc..." or "os_0a19...".
Prefixes: ln (Lightning), or (on-chain receive), os (on-chain send),
fr (offer receive), fs (offer send).
Variants§
OfferRecvReusable(LnClaimId)
OfferSend(ClientPaymentId)
Lightning(PaymentHash)
OnchainRecv(Txid)
OnchainSend(ClientPaymentId)
Implementations§
§impl PaymentId
impl PaymentId
pub fn prefix(&self) -> &'static str
pub fn prefix(&self) -> &'static str
Returns the prefix to use when serializing this payment id to a string.
pub fn from_ldk_event(
ldk_payment_id: Option<PaymentId>,
payment_hash: PaymentHash,
) -> PaymentId
pub fn from_ldk_event( ldk_payment_id: Option<PaymentId>, payment_hash: PaymentHash, ) -> PaymentId
Construct an PaymentId from LDK event fields.
pub fn from_payment_failed(
ldk_payment_id: PaymentId,
payment_hash: Option<PaymentHash>,
) -> PaymentId
pub fn from_payment_failed( ldk_payment_id: PaymentId, payment_hash: Option<PaymentHash>, ) -> PaymentId
From the data we get in a PaymentFailed event, determine the payment
id for this outbound lightning payment.
Trait Implementations§
§impl<'de> Deserialize<'de> for PaymentId
impl<'de> Deserialize<'de> for PaymentId
§fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for PaymentId
impl Ord for PaymentId
§impl PartialOrd for PaymentId
impl PartialOrd for PaymentId
§impl Serialize for PaymentId
impl Serialize for PaymentId
§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
§impl TryFrom<PaymentId> for ClientPaymentId
impl TryFrom<PaymentId> for ClientPaymentId
§impl TryFrom<PaymentId> for PaymentHash
impl TryFrom<PaymentId> for PaymentHash
impl Copy for PaymentId
impl Eq for PaymentId
impl StructuralPartialEq for PaymentId
Auto Trait Implementations§
impl Freeze for PaymentId
impl RefUnwindSafe for PaymentId
impl Send for PaymentId
impl Sync for PaymentId
impl Unpin for PaymentId
impl UnwindSafe for PaymentId
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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.