Struct redis_module::key::RedisKeyWritable[][src]

pub struct RedisKeyWritable { /* fields omitted */ }

RedisKeyWritable is an abstraction over a Redis key that allows read and write operations.

Implementations

impl RedisKeyWritable[src]

pub fn open(ctx: *mut RedisModuleCtx, key: &str) -> RedisKeyWritable[src]

pub fn read(&self) -> Result<Option<String>, RedisError>[src]

Detects whether the value stored in a Redis key is empty.

Note that an empty key can be reliably detected by looking for a null as you open the key in read mode, but when asking for write Redis returns a non-null pointer to allow us to write to even an empty key, so we have to check the key’s value instead.

pub fn hash_set(&self, field: &str, value: RedisString) -> Status[src]

pub fn hash_del(&self, field: &str) -> Status[src]

pub fn hash_get(&self, field: &str) -> Result<Option<RedisString>, RedisError>[src]

pub fn hash_get_multi<'a, A, B>(
    &self,
    fields: &'a [A]
) -> Result<HMGetResult<'a, A, B>, RedisError> where
    A: Into<Vec<u8>> + Clone,
    RedisString: Into<B>, 
[src]

Returns the values associated with the specified fields in the hash stored at this key.

pub fn set_expire(&self, expire: Duration) -> RedisResult[src]

pub fn write(&self, val: &str) -> RedisResult[src]

pub fn delete(&self) -> RedisResult[src]

pub fn key_type(&self) -> KeyType[src]

pub fn is_empty(&self) -> bool[src]

pub fn get_value<T>(
    &self,
    redis_type: &RedisType
) -> Result<Option<&mut T>, RedisError>
[src]

pub fn set_value<T>(
    &self,
    redis_type: &RedisType,
    value: T
) -> Result<(), RedisError>
[src]

Trait Implementations

impl Drop for RedisKeyWritable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.