pub struct CommandFilterCtx { /* private fields */ }
Implementations§
Source§impl CommandFilterCtx
wrapping the RedisModuleCommandFilterCtx to provide a higher level interface to call RedisModule_CommandFilter*
impl CommandFilterCtx
wrapping the RedisModuleCommandFilterCtx to provide a higher level interface to call RedisModule_CommandFilter*
provides functions to interact with the command filter context, such as getting the number of arguments, getting and replacing arguments, and deleting arguments.
pub fn new(inner: *mut RedisModuleCommandFilterCtx) -> Self
Sourcepub fn args_count(&self) -> c_int
pub fn args_count(&self) -> c_int
wrapper for RedisModule_CommandFilterArgsCount
Sourcepub fn arg_get(&self, pos: c_int) -> *mut RedisModuleString
pub fn arg_get(&self, pos: c_int) -> *mut RedisModuleString
wrapper for RedisModule_CommandFilterArgGet
Sourcepub fn arg_get_try_as_str<'a>(&self, pos: c_int) -> Result<&'a str, Utf8Error>
pub fn arg_get_try_as_str<'a>(&self, pos: c_int) -> Result<&'a str, Utf8Error>
wrapper to get argument as a Result<&str, Utf8Error> instead of RedisModuleString
Sourcepub fn cmd_get_try_as_str<'a>(&self) -> Result<&'a str, Utf8Error>
pub fn cmd_get_try_as_str<'a>(&self) -> Result<&'a str, Utf8Error>
wrapper to get 0 argument, the command which is always present and return as &str
Sourcepub fn get_all_args_wo_cmd(&self) -> Vec<&str>
pub fn get_all_args_wo_cmd(&self) -> Vec<&str>
wrapper to get Vector of all args minus the command (0th arg)
Sourcepub fn arg_replace(&self, pos: c_int, arg: &str)
pub fn arg_replace(&self, pos: c_int, arg: &str)
wrapper for RedisModule_CommandFilterArgReplace, accepts simple &str and casts it to *mut RedisModuleString
Sourcepub fn arg_insert(&self, pos: c_int, arg: &str)
pub fn arg_insert(&self, pos: c_int, arg: &str)
wrapper for RedisModule_CommandFilterArgInsert, accepts simple &str and casts it to *mut RedisModuleString
Sourcepub fn arg_delete(&self, pos: c_int)
pub fn arg_delete(&self, pos: c_int)
wrapper for RedisModule_CommandFilterArgDelete