pub enum PaymentKind {
Onchain,
Invoice,
Offer,
Spontaneous,
WaivedChannelFee,
WaivedLiquidityFee,
Unknown(Box<str>),
}Expand description
A fine-grained category for a payment. Useful for filtering payment history and analytics (e.g. regular Lightning payments vs. waived channel fees).
Each PaymentKind maps to exactly one parent PaymentRail via
PaymentKind::rail().
Variants§
Onchain
A regular on-chain send or receive. All v1 on-chain payments which had no kind are given this kind.
Invoice
A regular Lightning send or receive. All v1 invoice payments which had no kind are given this kind.
Offer
A regular Lightning offer payment. All v1 offer payments which had no kind are given this kind.
Spontaneous
A regular Lightning spontaneous payment. All v1 spontaneous payments which had no kind are given this kind.
WaivedChannelFee
A channel fee that would have been paid but was waived.
WaivedLiquidityFee
A liquidity fee that would have been paid but was waived.
Unknown(Box<str>)
Unknown kind; used for forward compatibility.
Implementations§
Source§impl PaymentKind
impl PaymentKind
Sourcepub const KNOWN_VARIANTS: &'static [PaymentKind]
pub const KNOWN_VARIANTS: &'static [PaymentKind]
All non-unknown variants.
pub fn to_str(&self) -> Cow<'static, str>
pub fn rail(&self) -> PaymentRail
Sourcepub fn expect_rail(&self, expected: PaymentRail) -> Result<(), Error>
pub fn expect_rail(&self, expected: PaymentRail) -> Result<(), Error>
Validates this payment kind against an expected parent rail.
Trait Implementations§
Source§impl Clone for PaymentKind
impl Clone for PaymentKind
Source§fn clone(&self) -> PaymentKind
fn clone(&self) -> PaymentKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PaymentKind
impl Debug for PaymentKind
Source§impl<'de> Deserialize<'de> for PaymentKind
impl<'de> Deserialize<'de> for PaymentKind
Source§fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for PaymentKind
impl Display for PaymentKind
Source§impl FromStr for PaymentKind
impl FromStr for PaymentKind
Source§type Err = Infallible
type Err = Infallible
Source§fn from_str(s: &str) -> Result<PaymentKind, <PaymentKind as FromStr>::Err>
fn from_str(s: &str) -> Result<PaymentKind, <PaymentKind as FromStr>::Err>
s to return a value of this type. Read moreSource§impl PartialEq for PaymentKind
impl PartialEq for PaymentKind
Source§impl Serialize for PaymentKind
impl Serialize for PaymentKind
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,
impl Eq for PaymentKind
impl StructuralPartialEq for PaymentKind
Auto Trait Implementations§
impl Freeze for PaymentKind
impl RefUnwindSafe for PaymentKind
impl Send for PaymentKind
impl Sync for PaymentKind
impl Unpin for PaymentKind
impl UnsafeUnpin for PaymentKind
impl UnwindSafe for PaymentKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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.