pub struct InMemoryBackend { /* private fields */ }Expand description
内存后端(模拟 Redis)
使用 RwLock<HashMap> 存储计数器,模拟 Redis 的 INCR + EXPIRE 行为。
适用于单机场景和测试,不适用于真正的分布式环境。
Implementations§
Trait Implementations§
Source§impl Default for InMemoryBackend
impl Default for InMemoryBackend
Source§impl DistributedBackend for InMemoryBackend
impl DistributedBackend for InMemoryBackend
Auto Trait Implementations§
impl !Freeze for InMemoryBackend
impl RefUnwindSafe for InMemoryBackend
impl Send for InMemoryBackend
impl Sync for InMemoryBackend
impl Unpin for InMemoryBackend
impl UnsafeUnpin for InMemoryBackend
impl UnwindSafe for InMemoryBackend
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