Struct PaymentCreatedIndex
pub struct PaymentCreatedIndex {
pub created_at: TimestampMs,
pub id: LxPaymentId,
}Expand description
A payment identifier which:
- retains uniqueness per payment
- is ordered first by
created_attimestamp and then byLxPaymentId.
It is essentially a [(TimestampMs, LxPaymentId)], suitable for use as a
key in a BTreeMap<PaymentCreatedIndex, BasicPaymentV1> or similar.
It can also be degenerated (serialized) into a string and the string-serialized ordering will be equivalent to the unserialized ordering.
§Examples
ⓘ
0002683862736062841-os_95cc800f4f3b5669c71c85f7096be45a172ca86aef460e0e584affff3ea80bee
0009557253037960566-ln_3ddcfd0e0b1eba77292c23a7de140c1e71327ac97486cc414b6826c434c560cc
4237937319278351047-or_3f6d2153bde1a0878717f46a1cbc63c48f7b4231224d78a50eb9e94b5d29f674
6206503357534413026-ln_063a5be0218332a84f9a4f7f4160a7dcf8e9362b9f5043ad47360c7440037fa8
6450440432938623603-or_0db1f1ebed6f99574c7a048e6bbf68c7db69c6da328f0b6d699d4dc1cd477017
7774176661032219027-or_215ef16c8192c8d674b519a34b7b65454e1e18d48bf060bdc333df433ada0137
8468903867373394879-ln_b8cbf827292c2b498e74763290012ed92a0f946d67e733e94a5fedf7f82710d5
8776421933930532767-os_ead3c01be0315dfd4e4c405aaca0f39076cff722a0f680c89c348e3bda9575f3Fields§
§created_at: TimestampMs§id: LxPaymentIdImplementations§
§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
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 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>,
Deserialize this value from the given Serde deserializer. Read more
§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 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,
Compares and returns the maximum of two values. Read more
§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,
Serialize this value into the given Serde serializer. Read more
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 UnwindSafe for PaymentCreatedIndex
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.