pub struct BoundedReplayStore { /* private fields */ }Expand description
Process-local TTL replay store with LRU ordering and fail-closed capacity.
Live entries are never evicted merely to make space because doing so would reopen their replay window. LRU ordering is used to remove expired entries deterministically; a full live set rejects new requests.
Implementations§
Source§impl BoundedReplayStore
impl BoundedReplayStore
Sourcepub fn new(config: ReplayStoreConfig) -> Self
pub fn new(config: ReplayStoreConfig) -> Self
Creates an empty bounded replay store.
Trait Implementations§
Source§impl Debug for BoundedReplayStore
impl Debug for BoundedReplayStore
Source§impl PeerNonceStore for BoundedReplayStore
impl PeerNonceStore for BoundedReplayStore
Source§fn check_and_record(
&self,
nonce: &str,
expires_at_ms: u64,
now_ms: u64,
) -> Result<(), PeerRpcError>
fn check_and_record( &self, nonce: &str, expires_at_ms: u64, now_ms: u64, ) -> Result<(), PeerRpcError>
Rejects a live duplicate or records the nonce until
expires_at_ms.Source§impl ReplayStore for BoundedReplayStore
impl ReplayStore for BoundedReplayStore
Auto Trait Implementations§
impl !Freeze for BoundedReplayStore
impl RefUnwindSafe for BoundedReplayStore
impl Send for BoundedReplayStore
impl Sync for BoundedReplayStore
impl Unpin for BoundedReplayStore
impl UnsafeUnpin for BoundedReplayStore
impl UnwindSafe for BoundedReplayStore
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