Struct RedisRocksdb

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

Implementations§

Trait Implementations§

Source§

impl KeyValue for RedisRocksdb

Source§

fn get<K: Bytes, V: Bytes>(&self, key: &K) -> Result<Option<Vec<u8>>, RrError>

Source§

fn put<K: Bytes, V: Bytes>(&mut self, key: &K, value: &V) -> Result<(), RrError>

Source§

impl RedisList for RedisRocksdb

[see] (https://xindoo.blog.csdn.net/article/details/109150975) ssdb没有实现list,只实现了queue

redis中的list使用quicklist与ziplist实现

Source§

fn list_blpop<K: Bytes, V: Bytes>( &mut self, _key: &K, _timeout: i64, ) -> Result<V, RrError>

Source§

fn list_brpop<K: Bytes, V: Bytes>( &mut self, _key: &K, _timeout: i64, ) -> Result<V, RrError>

Source§

fn list_brpoplpush<K: Bytes, V: Bytes>( &mut self, _srckey: &K, _dstkey: &K, _timeout: i64, ) -> Result<V, RrError>

Source§

fn list_index<K: Bytes>(&self, key: &K, index: i32) -> Result<Vec<u8>, RrError>

Source§

fn list_insert_before<K: Bytes, V: Bytes>( &mut self, key: &K, pivot: &V, value: &V, ) -> Result<i32, RrError>

如果命令执行成功,返回插入操作完成之后,列表的长度。 如果没有找到指定元素 ,返回 -1 。 如果 key 不存在或为空列表,返回 0
Source§

fn list_insert_after<K: Bytes, V: Bytes>( &mut self, key: &K, pivot: &V, value: &V, ) -> Result<i32, RrError>

如果命令执行成功,返回插入操作完成之后,列表的长度。 如果没有找到指定元素 ,返回 -1 。 如果 key 不存在或为空列表,返回 0
Source§

fn list_len<K: Bytes>(&self, key: &K) -> Result<i32, RrError>

Source§

fn list_pop_front<K: Bytes>( &mut self, key: &K, ) -> Result<Option<Vec<u8>>, RrError>

对应redis的 lpop,由于lpop命名,不是很明确,所以改名
Source§

fn list_push_front<K: Bytes, V: Bytes>( &mut self, key: &K, value: &V, ) -> Result<i32, RrError>

返回len of list 对应redis的lpush,由于lpush命名,不是很明确,所以改名
Source§

fn list_push_front_exists<K: Bytes, V: Bytes>( &mut self, key: &K, value: &V, ) -> Result<i32, RrError>

返回len of list,如果list不存在返回值为 0 对应redis的lpushx
Source§

fn list_range<K: Bytes>( &self, key: &K, start: i32, stop: i32, ) -> Result<Vec<Vec<u8>>, RrError>

返回在range范围内的元素,所以start与stop可能会在list的下标之外。range是包含stop的 如果一个都没有找到,返回为len为0的Vec 0表示第一个元素 -1表示倒数第一个元素 -100 100表示从到数100个元素到第101个元素。如果这时list中只有3个元素,返回所有的值,因为这3个都在 range的范围之内
Source§

fn list_rem<K: Bytes, V: Bytes>( &mut self, list_key: &K, count: i32, value: &V, ) -> Result<LenType, RrError>

返回值为删除的数量 COUNT 的值可以是以下几种: count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT。 count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值。 count = 0 : 移除表中所有与 VALUE 相等的值
Source§

fn list_trim<K: Bytes>( &mut self, _key: K, _start: i32, _stop: i32, ) -> Result<i32, RrError>

保留指定区间内的元素,不在指定区间之内的元素都将被删除, 反回删除的元素数量
Source§

fn list_set<K: Bytes, V: Bytes>( &mut self, key: &K, index: i32, value: &V, ) -> Result<Vec<u8>, RrError>

index无效或list为空时,返回错误。其余返回原来的值
Source§

fn list_pop_back<K: Bytes>( &mut self, key: &K, ) -> Result<Option<Vec<u8>>, RrError>

移除列表的最后一个元素
Source§

fn list_replace_back<K: Bytes, V: Bytes>( &mut self, _key: &K, _dstkey: &K, ) -> Result<V, RrError>

移除列表的最后一个元素,并将该元素添加到另一个列表并返回 对应redis的rpoplpush
Source§

fn list_push_back<K: Bytes, V: Bytes>( &mut self, key: &K, value: &V, ) -> Result<i32, RrError>

返回len of list 对应redis的rpush
Source§

fn list_push_back_exists<K: Bytes, V: Bytes>( &mut self, key: &K, value: &V, ) -> Result<i32, RrError>

为已经存在的列表添加值, 添加到尾部 对应redis的rpushx
Source§

fn list_clear<K: Bytes>(&mut self, key: &K) -> Result<i32, RrError>

返回len of list
Source§

impl Stack for RedisRocksdb

Source§

fn index<K: Bytes>(&self, key: &K, _index: i64) -> Result<Vec<u8>, RrError>

get the index of data
Source§

fn len<K: Bytes>(&self, _key: &K) -> Result<i64, RrError>

let of list, if the list do not exist return is -1
Source§

fn push<K: Bytes, V: Bytes>( &mut self, _key: &K, _value: &V, ) -> Result<i64, RrError>

push a value to end, if the list do not exit, create it and push
Source§

fn pushs<K: Bytes, V: Bytes>( &mut self, _key: &K, _values: &[&V], ) -> Result<i64, RrError>

Source§

fn push_exists<K: Bytes, V: Bytes>( &mut self, _key: &K, _value: &V, ) -> Result<i64, RrError>

push a value if the list exist. if list do not exist, return -1 and do nothing
Source§

fn range<K: Bytes>( &self, _key: &K, _start: i64, _stop: i64, ) -> Result<Vec<Vec<u8>>, RrError>

返回在range范围内的元素,所以start与stop可能会在list的下标之外。range是包含stop的 如果一个都没有找到,返回为len为0的Vec 0表示第一个元素 -1表示倒数第一个元素 -100 100表示从到数100个元素到第101个元素。如果这时list中只有3个元素,返回所有的值,因为这3个都在 range的范围之内
Source§

fn set<K: Bytes, V: Bytes>( &mut self, _key: &K, _index: i64, _value: &V, ) -> Result<Vec<u8>, RrError>

index invalid or list is empty,return error.
Source§

fn pop<K: Bytes>(&self, _key: &K) -> Result<Vec<u8>, RrError>

remove the value of end
Source§

fn pops<K: Bytes>( &self, _key: &K, _amount: u64, ) -> Result<Vec<Vec<u8>>, RrError>

remove the value of end
Source§

fn poplpush<K: Bytes, V: Bytes>( &mut self, _key: &K, _dstkey: &K, ) -> Result<V, RrError>

pop the last value to other stack
Source§

fn clear<K: Bytes>(&mut self, _key: &K) -> Result<i64, RrError>

clear the stack, return the len of stack. if the stack do not exist, return -1

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V