struct Quota {
leases: FnvHashMap<Rc<str>, Lease>,
dim_count: FnvHashMap<Rc<str>, u64>,
expiry_timeouts: BTreeSet<(NonZeroU64, Rc<str>)>,
}
Fields§
§leases: FnvHashMap<Rc<str>, Lease>
§dim_count: FnvHashMap<Rc<str>, u64>
§expiry_timeouts: BTreeSet<(NonZeroU64, Rc<str>)>
Implementations§
Source§impl Quota
impl Quota
fn rdb_load(rdb: &mut RdbLoadIo, version: i32) -> RedisResult<Self>
fn rdb_save(&mut self, rdb: &mut RdbSaveIo)
fn aof_rewrite( &mut self, aof: &mut AofRewriteIo, key: RedisString, ) -> RedisResult<()>
fn mem_usage(&self) -> usize
Source§impl Quota
impl Quota
fn gc(&mut self, now_ts: NonZeroU64)
fn expires_at(&self) -> Option<NonZeroU64>
fn remove_lease(&mut self, id: &str) -> bool
fn insert_lease(&mut self, lease: Lease)
fn renew_lease( &mut self, id: &str, now: NonZeroU64, expires_at: Option<NonZeroU64>, ) -> bool
Trait Implementations§
Source§impl AofRewrite<Tmp> for Quota
impl AofRewrite<Tmp> for Quota
const FN: AofRewriteFn<Self> = {quota::Quota::aof_rewrite as for<'a, 'b> fn(&'a mut quota::Quota, &'b mut redis_module_ext::data_type::AofRewriteIo, redis_module::RedisString) -> std::result::Result<(), redis_module::RedisError>}
fn extern_fn() -> Option<unsafe extern "C" fn(*mut RedisModuleIO, *mut RedisModuleString, *mut c_void)>
Source§impl DeepSizeOf for Quota
impl DeepSizeOf for Quota
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
Source§impl RedisDataType for Quota
impl RedisDataType for Quota
Auto Trait Implementations§
impl Freeze for Quota
impl RefUnwindSafe for Quota
impl !Send for Quota
impl !Sync for Quota
impl Unpin for Quota
impl UnwindSafe for Quota
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more