Struct PaymentCreatedIndex
pub struct PaymentCreatedIndex {
pub created_at: TimestampMs,
pub id: PaymentId,
}Expand description
A unique, ordered payment identifier: (created_at, payment_id).
Essentially a (TimestampMs, PaymentId) which:
- retains uniqueness per payment, and
- is ordered first by
created_attimestamp and then byPaymentId.
String-serialized as <created_at>-<id>, e.g.:
“0002683862736062841-ln_003dd23aec576e7d0d85aa991ff9c2dc471fd7c863ff31b93bfbb02836eb56b5”.
The string’s lexicographic order matches the struct’s Ord.
Recommendation to SDK users: Prefer this as the primary identifier for a
payment, as you can degenerate it into a String while retaining
timestamp-based lexicographic sorting for free, e.g. BTreeMap<String, Payment> or BTreeMap<PaymentCreatedIndex, Payment>. Fall back to the
inner PaymentId only if that’s all you have, e.g. a BOLT 11 invoice’s
payment hash.
Fields§
§created_at: TimestampMs§id: PaymentIdImplementations§
§impl PaymentCreatedIndex
impl PaymentCreatedIndex
pub const MIN: PaymentCreatedIndex
pub const MIN: PaymentCreatedIndex
The index that is lexicographically <= all other indexes.
pub const MAX: PaymentCreatedIndex
pub const MAX: PaymentCreatedIndex
The index that is lexicographically >= all other indexes.
Trait Implementations§
§impl Clone for PaymentCreatedIndex
impl Clone for PaymentCreatedIndex
§fn clone(&self) -> PaymentCreatedIndex
fn clone(&self) -> PaymentCreatedIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PaymentCreatedIndex
impl Debug for PaymentCreatedIndex
§impl<'de> Deserialize<'de> for PaymentCreatedIndex
impl<'de> Deserialize<'de> for PaymentCreatedIndex
§fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentCreatedIndex, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<PaymentCreatedIndex, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for PaymentCreatedIndex
<created_at>-<id>
impl Display for PaymentCreatedIndex
<created_at>-<id>
When serializing to string, pad the timestamp with leading zeroes (up to the
maximum number of digits in an i64) so that the lexicographic ordering
is equivalent to the non-serialized ordering.
§impl FromStr for PaymentCreatedIndex
<created_at>-<id>
impl FromStr for PaymentCreatedIndex
<created_at>-<id>
§impl Hash for PaymentCreatedIndex
impl Hash for PaymentCreatedIndex
§impl Ord for PaymentCreatedIndex
impl Ord for PaymentCreatedIndex
§fn cmp(&self, other: &PaymentCreatedIndex) -> Ordering
fn cmp(&self, other: &PaymentCreatedIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for PaymentCreatedIndex
impl PartialEq for PaymentCreatedIndex
§impl PartialOrd for PaymentCreatedIndex
impl PartialOrd for PaymentCreatedIndex
§impl Serialize for PaymentCreatedIndexwhere
PaymentCreatedIndex: Display,
impl Serialize for PaymentCreatedIndexwhere
PaymentCreatedIndex: 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,
impl Copy for PaymentCreatedIndex
impl Eq for PaymentCreatedIndex
impl StructuralPartialEq for PaymentCreatedIndex
Auto Trait Implementations§
impl Freeze for PaymentCreatedIndex
impl RefUnwindSafe for PaymentCreatedIndex
impl Send for PaymentCreatedIndex
impl Sync for PaymentCreatedIndex
impl Unpin for PaymentCreatedIndex
impl UnsafeUnpin for PaymentCreatedIndex
impl UnwindSafe for PaymentCreatedIndex
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
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
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.