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
impl Bucket
[src]
impl Bucket
[src]pub fn on_delete(
ctx: &Context,
_event_type: NotifyEvent,
_event: &str,
key_name: &str
)
[src]
ctx: &Context,
_event_type: NotifyEvent,
_event: &str,
key_name: &str
)
fn new(ctx: &Context, duration: u64) -> Result<Self, CacheError>
[src]
creates new bucket and sets off timer to go off at duration
fn decrement_runner(ctx: &Context, key: &RedisKeyWritable)
[src]
decrement runner that decrements all registered counts without cleaning after itself use [decrement] when you require auto cleanup. Internally, it calls this method.
fn decrement(ctx: &Context, bucket_instant: u64)
[src]
executes when timer goes off. Decrements all registered counts and cleans itself up
fn increment(ctx: &Context, captcha: &str) -> Result<String, CacheError>
[src]
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]
ctx: &Context,
(captcha_name, duration): (String, u64),
increment_by: u32
) -> Result<(), CacheError>
open bucket, set decrement by specified number
pub fn counter_create(ctx: &Context, args: Vec<RedisString>) -> RedisResult
[src]
Create new counter
Trait Implementations
impl<'de> Deserialize<'de> for Bucket
[src]
impl<'de> Deserialize<'de> for Bucket
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,