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]
&self,
fields: &'a [A]
) -> Result<HMGetResult<'a, A, B>, RedisError> where
A: Into<Vec<u8>> + Clone,
RedisString: Into<B>,
Returns the values associated with the specified fields in the hash stored at this key.
pub fn list_push_head(&self, element: RedisString) -> Status[src]
pub fn list_push_tail(&self, element: RedisString) -> Status[src]
pub fn list_pop_head(&self) -> Option<RedisString>[src]
pub fn list_pop_tail(&self) -> Option<RedisString>[src]
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]
&self,
redis_type: &RedisType
) -> Result<Option<&mut T>, RedisError>
pub fn set_value<T>(
&self,
redis_type: &RedisType,
value: T
) -> Result<(), RedisError>[src]
&self,
redis_type: &RedisType,
value: T
) -> Result<(), RedisError>
Trait Implementations
impl Drop for RedisKeyWritable[src]
Auto Trait Implementations
impl RefUnwindSafe for RedisKeyWritable
impl !Send for RedisKeyWritable
impl !Sync for RedisKeyWritable
impl Unpin for RedisKeyWritable
impl UnwindSafe for RedisKeyWritable
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,