Enum LxPaymentId
pub enum LxPaymentId {
OfferRecvReusable(LnClaimId),
OfferSend(ClientPaymentId),
Lightning(LxPaymentHash),
OnchainRecv(LxTxid),
OnchainSend(ClientPaymentId),
}Expand description
A globally-unique identifier for any type of payment, including both on-chain and Lightning payments.
- Lightning inbound+outbound invoice+spontaneous payments use their
LxPaymentHashas their id. TODO(phlip9): inbound spontaneous payments should useLnClaimIdas their id. - Lightning reusable inbound offer payments use the [
LnClaimId] as their id. - Lightning single-use inbound offer payments use the [
OfferId] as their id. TODO(phlip9): impl - Lightning outbound offer payments use a [
ClientPaymentId] as their id. - On-chain sends use a [
ClientPaymentId] as their id. - On-chain receives use their
LxTxidas their id.
NOTE that this is NOT a drop-in replacement for LDK’s PaymentId, since
PaymentId is Lightning-specific, whereas LxPaymentId is not.
Variants§
OfferRecvReusable(LnClaimId)
OfferSend(ClientPaymentId)
Lightning(LxPaymentHash)
OnchainRecv(LxTxid)
OnchainSend(ClientPaymentId)
Implementations§
§impl LxPaymentId
impl LxPaymentId
pub const MIN: LxPaymentId
pub const MIN: LxPaymentId
The LxPaymentId that is lexicographically <= all other ids.
pub const MAX: LxPaymentId
pub const MAX: LxPaymentId
The LxPaymentId that is lexicographically >= all other ids.
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: LxPaymentHash,
) -> LxPaymentId
pub fn from_ldk_event( ldk_payment_id: Option<PaymentId>, payment_hash: LxPaymentHash, ) -> LxPaymentId
Construct an LxPaymentId from LDK event fields.
pub fn from_payment_failed(
ldk_payment_id: PaymentId,
payment_hash: Option<LxPaymentHash>,
) -> LxPaymentId
pub fn from_payment_failed( ldk_payment_id: PaymentId, payment_hash: Option<LxPaymentHash>, ) -> LxPaymentId
From the data we get in a PaymentFailed event, determine the payment
id for this outbound lightning payment.
Trait Implementations§
§impl Clone for LxPaymentId
impl Clone for LxPaymentId
§fn clone(&self) -> LxPaymentId
fn clone(&self) -> LxPaymentId
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 more§impl Debug for LxPaymentId
impl Debug for LxPaymentId
§impl<'de> Deserialize<'de> for LxPaymentId
impl<'de> Deserialize<'de> for LxPaymentId
§fn deserialize<__D>(
deserializer: __D,
) -> Result<LxPaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<LxPaymentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for LxPaymentId
<kind>_<id>
impl Display for LxPaymentId
<kind>_<id>
§impl FromStr for LxPaymentId
<kind>_<id>
impl FromStr for LxPaymentId
<kind>_<id>
§impl Hash for LxPaymentId
impl Hash for LxPaymentId
§impl Ord for LxPaymentId
impl Ord for LxPaymentId
§impl PartialEq for LxPaymentId
impl PartialEq for LxPaymentId
§impl PartialOrd for LxPaymentId
impl PartialOrd for LxPaymentId
§impl Serialize for LxPaymentIdwhere
LxPaymentId: Display,
impl Serialize for LxPaymentIdwhere
LxPaymentId: Display,
§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<LxPaymentId> for LxPaymentHash
impl TryFrom<LxPaymentId> for LxPaymentHash
§fn try_from(id: LxPaymentId) -> Result<LxPaymentHash, Error>
fn try_from(id: LxPaymentId) -> Result<LxPaymentHash, Error>
Performs the conversion.
impl Copy for LxPaymentId
impl Eq for LxPaymentId
impl StructuralPartialEq for LxPaymentId
Auto Trait Implementations§
impl Freeze for LxPaymentId
impl RefUnwindSafe for LxPaymentId
impl Send for LxPaymentId
impl Sync for LxPaymentId
impl Unpin for LxPaymentId
impl UnwindSafe for LxPaymentId
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.