pub struct OptimizedProofEntry {
pub mutation_hash: [u8; 32],
pub nonce: u64,
pub inserted_at: u64,
pub proof_id: u32,
pub flags: u32,
/* private fields */
}Expand description
Optimized cache entry aligned to reduce cache pressure.
Fields§
§mutation_hash: [u8; 32]Hash of the mutation this proof authorizes.
nonce: u64Single-use nonce for this proof.
inserted_at: u64Timestamp when the entry was inserted (nanoseconds).
proof_id: u32Unique proof identifier returned on successful verification.
flags: u32Entry state flags.
Implementations§
Source§impl OptimizedProofEntry
impl OptimizedProofEntry
Sourcepub const FLAG_VALID: u32
pub const FLAG_VALID: u32
Flag indicating entry is valid.
Sourcepub const FLAG_CONSUMED: u32
pub const FLAG_CONSUMED: u32
Flag indicating entry has been consumed.
Sourcepub const fn new(
mutation_hash: [u8; 32],
nonce: u64,
proof_id: u32,
inserted_at: u64,
) -> Self
pub const fn new( mutation_hash: [u8; 32], nonce: u64, proof_id: u32, inserted_at: u64, ) -> Self
Creates a new valid entry.
Sourcepub const fn is_consumed(&self) -> bool
pub const fn is_consumed(&self) -> bool
Returns true if entry has been consumed.
Sourcepub const fn is_expired(&self, current_time_ns: u64) -> bool
pub const fn is_expired(&self, current_time_ns: u64) -> bool
Returns true if entry has expired.
Sourcepub fn matches(&self, mutation_hash: &[u8; 32], nonce: u64) -> bool
pub fn matches(&self, mutation_hash: &[u8; 32], nonce: u64) -> bool
Checks if entry matches hash and nonce.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Invalidates the entry.
Trait Implementations§
Source§impl Clone for OptimizedProofEntry
impl Clone for OptimizedProofEntry
Source§fn clone(&self) -> OptimizedProofEntry
fn clone(&self) -> OptimizedProofEntry
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 OptimizedProofEntry
impl Debug for OptimizedProofEntry
impl Copy for OptimizedProofEntry
Auto Trait Implementations§
impl Freeze for OptimizedProofEntry
impl RefUnwindSafe for OptimizedProofEntry
impl Send for OptimizedProofEntry
impl Sync for OptimizedProofEntry
impl Unpin for OptimizedProofEntry
impl UnsafeUnpin for OptimizedProofEntry
impl UnwindSafe for OptimizedProofEntry
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