Struct governor::state::InMemoryState
source · pub struct InMemoryState(/* private fields */);
Expand description
An in-memory representation of a GCRA’s rate-limiting state.
Implemented using AtomicU64
operations, this state representation can be used to
construct rate limiting states for other in-memory states: e.g., this crate uses
InMemoryState
as the states it tracks in the keyed rate limiters it implements.
Internally, the number tracked here is the theoretical arrival time (a GCRA term) in number of nanoseconds since the rate limiter was created.
Trait Implementations§
source§impl Debug for InMemoryState
impl Debug for InMemoryState
source§impl Default for InMemoryState
impl Default for InMemoryState
source§fn default() -> InMemoryState
fn default() -> InMemoryState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryState
impl RefUnwindSafe for InMemoryState
impl Send for InMemoryState
impl Sync for InMemoryState
impl Unpin for InMemoryState
impl UnwindSafe for InMemoryState
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