Struct cache::bucket::Bucket [−][src]
Fields
timer: u64
timer ID
bucket_instant: u64
instant(seconds from UNIX_EPOCH) at which time bucket begins decrement process
decrement: HashMap<String, u32>
a list of captcha keys that should be decremented during clean up
Implementations
creates new bucket and sets off timer to go off at duration
decrement runner that decrements all registered counts without cleaning after itself use [decrement] when you require auto cleanup. Internally, it calls this method.
executes when timer goes off. Decrements all registered counts and cleans itself up
increments count of key = captcha and registers for auto decrement
pub fn increment_by(
ctx: &Context,
(captcha_name, duration): (String, u64),
increment_by: u32
) -> Result<(), CacheError>
[src]
pub fn increment_by(
ctx: &Context,
(captcha_name, duration): (String, u64),
increment_by: u32
) -> Result<(), CacheError>
[src]open bucket, set decrement by specified number
Create new counter
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Bucket
impl UnwindSafe for Bucket
Blanket Implementations
Mutably borrows from an owned value. Read more