pub struct IdempotencyEntry {
pub fingerprint: RequestFingerprint,
pub response: Value,
pub created_at: u64,
pub expires_at: u64,
}Expand description
Idempotency entry stored in the cache
Fields§
§fingerprint: RequestFingerprintRequest fingerprint
response: ValueStored response
created_at: u64Creation timestamp (Unix epoch seconds)
expires_at: u64Expiration timestamp (Unix epoch seconds)
Implementations§
Source§impl IdempotencyEntry
impl IdempotencyEntry
Sourcepub fn new(
fingerprint: RequestFingerprint,
response: Value,
ttl_seconds: u64,
) -> Self
pub fn new( fingerprint: RequestFingerprint, response: Value, ttl_seconds: u64, ) -> Self
Create a new entry with TTL in seconds
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if entry is expired
Trait Implementations§
Source§impl Clone for IdempotencyEntry
impl Clone for IdempotencyEntry
Source§fn clone(&self) -> IdempotencyEntry
fn clone(&self) -> IdempotencyEntry
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 moreSource§impl Debug for IdempotencyEntry
impl Debug for IdempotencyEntry
Source§impl<'de> Deserialize<'de> for IdempotencyEntry
impl<'de> Deserialize<'de> for IdempotencyEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IdempotencyEntry
impl RefUnwindSafe for IdempotencyEntry
impl Send for IdempotencyEntry
impl Sync for IdempotencyEntry
impl Unpin for IdempotencyEntry
impl UnwindSafe for IdempotencyEntry
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
Mutably borrows from an owned value. Read more