Struct CommandFilterCtx

Source
pub struct CommandFilterCtx { /* private fields */ }

Implementations§

Source§

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.

Source

pub fn new(inner: *mut RedisModuleCommandFilterCtx) -> Self

Source

pub fn args_count(&self) -> c_int

wrapper for RedisModule_CommandFilterArgsCount

Source

pub fn arg_get(&self, pos: c_int) -> *mut RedisModuleString

wrapper for RedisModule_CommandFilterArgGet

Source

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

Source

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

Source

pub fn get_all_args_wo_cmd(&self) -> Vec<&str>

wrapper to get Vector of all args minus the command (0th arg)

Source

pub fn arg_replace(&self, pos: c_int, arg: &str)

wrapper for RedisModule_CommandFilterArgReplace, accepts simple &str and casts it to *mut RedisModuleString

Source

pub fn arg_insert(&self, pos: c_int, arg: &str)

wrapper for RedisModule_CommandFilterArgInsert, accepts simple &str and casts it to *mut RedisModuleString

Source

pub fn arg_delete(&self, pos: c_int)

wrapper for RedisModule_CommandFilterArgDelete

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.