1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use Cell;
use TimeStorage;
/// Non-atomic storage implementation for single-threaded use.
///
/// Uses [`Cell`] internally for efficient single-threaded access.
/// This storage type is not thread-safe and should only be used
/// when the token bucket will be accessed from a single thread.
///
/// # Performance
///
/// Offers the best performance for single-threaded scenarios as it
/// avoids the overhead of atomic operations.
///
/// # Examples
///
/// ```rust
/// use gardal::{TokenBucket, Limit, LocalStorage, StdClock};
/// use std::num::NonZeroU32;
///
/// let limit = Limit::per_second(NonZeroU32::new(100).unwrap());
/// let bucket = TokenBucket::<LocalStorage, _>::new(limit, StdClock);
/// ```
;