pub struct GcraCell { /* private fields */ }Expand description
Lock-free single-AtomicU64 GCRA state cell usable standalone or inside sharded maps.
Implementations§
Source§impl GcraCell
Lock-free atomic GCRA operations on GcraCell.
impl GcraCell
Lock-free atomic GCRA operations on GcraCell.
Sourcepub fn is_idle_at_ns(&self, now_ns: u64) -> bool
pub fn is_idle_at_ns(&self, now_ns: u64) -> bool
Sourcepub fn peek_at_ns(&self, config: &GcraConfig, now_ns: u64) -> RateLimitDecision
pub fn peek_at_ns(&self, config: &GcraConfig, now_ns: u64) -> RateLimitDecision
Sourcepub fn check_n_at_ns(
&self,
config: &GcraConfig,
now_ns: u64,
cost: u64,
) -> RateLimitDecision
pub fn check_n_at_ns( &self, config: &GcraConfig, now_ns: u64, cost: u64, ) -> RateLimitDecision
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GcraCell
impl Forget for GcraCell
impl Move for GcraCell
impl RefUnwindSafe for GcraCell
impl Send for GcraCell
impl Sync for GcraCell
impl Unpin for GcraCell
impl UnsafeUnpin for GcraCellwhere
Align8<u64>: UnsafeUnpin,
impl UnwindSafe for GcraCellwhere
Align8<u64>: UnwindSafe,
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