pub struct MCaptcha {
m: MCaptcha,
}
Fields§
§m: MCaptcha
Implementations§
source§impl MCaptcha
impl MCaptcha
pub fn get_add_visitor_result(&self) -> AddVisitorResult
fn new(m: CreateMCaptcha) -> Result<Self, CacheError>
sourcepub fn add_visitor(&mut self)
pub fn add_visitor(&mut self)
increments the visitor count by one
sourcepub fn get_difficulty(&self) -> u32
pub fn get_difficulty(&self) -> u32
get current difficulty factor
sourcepub fn get_duration(&self) -> u64
pub fn get_duration(&self) -> u64
get MCaptcha’s lifetime
sourcepub fn get_visitors(&self) -> u32
pub fn get_visitors(&self) -> u32
get MCaptcha’s current visitor_threshold
sourcepub fn decrement_visitor_by(&mut self, count: u32)
pub fn decrement_visitor_by(&mut self, count: u32)
decrement MCaptcha’s current visitor_threshold by specified count
sourcepub fn get_mut_mcaptcha(
key: &RedisKeyWritable
) -> Result<Option<&mut Self>, CacheError>
pub fn get_mut_mcaptcha(
key: &RedisKeyWritable
) -> Result<Option<&mut Self>, CacheError>
get mcaptcha from redis key writable
sourcepub fn get_mcaptcha(key: &RedisKey) -> Result<Option<&Self>, CacheError>
pub fn get_mcaptcha(key: &RedisKey) -> Result<Option<&Self>, CacheError>
get mcaptcha from redis key
sourcepub fn add_captcha(ctx: &Context, args: Vec<RedisString>) -> RedisResult
pub fn add_captcha(ctx: &Context, args: Vec<RedisString>) -> RedisResult
Add captcha to redis
fn add_captcha_runner(
ctx: &Context,
key_name: &str,
mcaptcha: MCaptcha
) -> RedisResult
sourcepub fn captcha_exists(ctx: &Context, args: Vec<RedisString>) -> RedisResult
pub fn captcha_exists(ctx: &Context, args: Vec<RedisString>) -> RedisResult
check if captcha exists
fn captcha_exists_runner(key: &RedisKey) -> bool
sourcepub fn rename(ctx: &Context, args: Vec<RedisString>) -> RedisResult
pub fn rename(ctx: &Context, args: Vec<RedisString>) -> RedisResult
implements mCaptcha rename: clones configuration from old name to new name and deletes oldname
sourcepub fn delete_captcha(ctx: &Context, args: Vec<RedisString>) -> RedisResult
pub fn delete_captcha(ctx: &Context, args: Vec<RedisString>) -> RedisResult
delete captcha
fn delete_captcha_runner(ctx: &Context, key_name: &str) -> RedisResult
Trait Implementations§
source§impl<'de> Deserialize<'de> for MCaptcha
impl<'de> Deserialize<'de> for MCaptcha
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more