pub struct AtomicStorage(/* private fields */);Expand description
Thread-safe atomic storage implementation.
Uses atomic operations for concurrent access to token bucket state. Suitable for multi-threaded scenarios where multiple threads need to access the same token bucket.
§Examples
use gardal::{TokenBucket, Limit, AtomicStorage, StdClock};
use std::num::NonZeroU32;
let limit = Limit::per_second(NonZeroU32::new(100).unwrap());
let bucket = TokenBucket::<AtomicStorage, _>::new(limit, StdClock);Trait Implementations§
Source§impl Debug for AtomicStorage
impl Debug for AtomicStorage
Source§impl TimeStorage for AtomicStorage
impl TimeStorage for AtomicStorage
Auto Trait Implementations§
impl !Freeze for AtomicStorage
impl RefUnwindSafe for AtomicStorage
impl Send for AtomicStorage
impl Sync for AtomicStorage
impl Unpin for AtomicStorage
impl UnsafeUnpin for AtomicStorage
impl UnwindSafe for AtomicStorage
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