pub struct DedupEntry { /* private fields */ }Expand description
Persisted dedup cache entry for one producer idempotency key.
Implementations§
Source§impl DedupEntry
impl DedupEntry
Sourcepub fn new(
idempotency_key: impl Into<String>,
receipt: Option<Vec<u8>>,
timestamp_millis: u64,
) -> Self
pub fn new( idempotency_key: impl Into<String>, receipt: Option<Vec<u8>>, timestamp_millis: u64, ) -> Self
Builds an entry containing the original key, optional receipt bytes, and epoch millis.
Sourcepub fn idempotency_key(&self) -> &str
pub fn idempotency_key(&self) -> &str
Returns the original idempotency key stored with this entry.
Sourcepub fn receipt(&self) -> Option<&[u8]>
pub fn receipt(&self) -> Option<&[u8]>
Returns the stored opaque receipt bytes, when processing has completed.
Sourcepub const fn timestamp_millis(&self) -> u64
pub const fn timestamp_millis(&self) -> u64
Returns the entry timestamp in epoch milliseconds.
Sourcepub fn serialize(&self) -> Result<Vec<u8>, DurabilityError>
pub fn serialize(&self) -> Result<Vec<u8>, DurabilityError>
Serializes this active cache entry into deterministic storage bytes.
§Errors
Returns DurabilityError::EnvelopeError when a field length cannot be encoded.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, DurabilityError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, DurabilityError>
Deserializes an active cache entry previously produced by Self::serialize.
§Errors
Returns DurabilityError::EnvelopeError when bytes are malformed or contain a tombstone.
Trait Implementations§
Source§impl Clone for DedupEntry
impl Clone for DedupEntry
Source§fn clone(&self) -> DedupEntry
fn clone(&self) -> DedupEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DedupEntry
impl Debug for DedupEntry
impl Eq for DedupEntry
Source§impl PartialEq for DedupEntry
impl PartialEq for DedupEntry
Source§fn eq(&self, other: &DedupEntry) -> bool
fn eq(&self, other: &DedupEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DedupEntry
Auto Trait Implementations§
impl Freeze for DedupEntry
impl RefUnwindSafe for DedupEntry
impl Send for DedupEntry
impl Sync for DedupEntry
impl Unpin for DedupEntry
impl UnsafeUnpin for DedupEntry
impl UnwindSafe for DedupEntry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.