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]
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 open_with_redis_string(
ctx: *mut RedisModuleCtx,
key: *mut RedisModuleString
) -> RedisKeyWritable
[src]
ctx: *mut RedisModuleCtx,
key: *mut RedisModuleString
) -> RedisKeyWritable
pub fn get_value<'a, 'b, T>(
&'a self,
redis_type: &RedisType
) -> Result<Option<&'b mut T>, RedisError>
[src]
&'a self,
redis_type: &RedisType
) -> Result<Option<&'b 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]
impl Drop for RedisKeyWritable
[src]Auto Trait Implementations
impl RefUnwindSafe for RedisKeyWritable
impl RefUnwindSafe for RedisKeyWritable
impl !Send for RedisKeyWritable
impl !Send for RedisKeyWritable
impl !Sync for RedisKeyWritable
impl !Sync for RedisKeyWritable
impl Unpin for RedisKeyWritable
impl Unpin for RedisKeyWritable
impl UnwindSafe for RedisKeyWritable
impl UnwindSafe for RedisKeyWritable