pub enum Cache {
Redis(Redis),
None,
}Variants§
Implementations§
Trait Implementations§
Source§impl CacheBase for Cache
impl CacheBase for Cache
Source§fn hash_add(
&mut self,
key: &str,
field: &str,
value: JsonValue,
) -> Result<bool, String>
fn hash_add( &mut self, key: &str, field: &str, value: JsonValue, ) -> Result<bool, String>
哈希 添加
Source§fn hash_get_field_value(
&mut self,
key: &str,
field: &str,
) -> Result<JsonValue, String>
fn hash_get_field_value( &mut self, key: &str, field: &str, ) -> Result<JsonValue, String>
哈希-获取指定字段的值
Source§fn key_set_expireat(
&mut self,
key: &str,
timestamp: i64,
) -> Result<bool, String>
fn key_set_expireat( &mut self, key: &str, timestamp: i64, ) -> Result<bool, String>
键 设置到期时间 Read more
Source§fn add(
&mut self,
key: &str,
value: JsonValue,
expiration_date: u64,
) -> Result<bool, String>
fn add( &mut self, key: &str, value: JsonValue, expiration_date: u64, ) -> Result<bool, String>
设置缓存 Read more
Source§fn set_add(
&mut self,
key: &str,
value: JsonValue,
expiry_s: i64,
) -> Result<bool, String>
fn set_add( &mut self, key: &str, value: JsonValue, expiry_s: i64, ) -> Result<bool, String>
集合 添加
Source§fn list_add(
&mut self,
key: &str,
value: JsonValue,
expiry_s: i64,
) -> Result<bool, String>
fn list_add( &mut self, key: &str, value: JsonValue, expiry_s: i64, ) -> Result<bool, String>
列表 添加
Source§fn geo_add(
&mut self,
key: &str,
longitude: f64,
latitude: f64,
value: JsonValue,
) -> Result<bool, String>
fn geo_add( &mut self, key: &str, longitude: f64, latitude: f64, value: JsonValue, ) -> Result<bool, String>
地理 添加地理位置
Source§fn geo_dist(
&mut self,
key: &str,
value1: JsonValue,
value2: JsonValue,
) -> Result<JsonValue, String>
fn geo_dist( &mut self, key: &str, value1: JsonValue, value2: JsonValue, ) -> Result<JsonValue, String>
地理 获取两地之间的距离地理位置
Source§fn geo_radius(
&mut self,
key: &str,
value: JsonValue,
radius: &str,
) -> Result<JsonValue, String>
fn geo_radius( &mut self, key: &str, value: JsonValue, radius: &str, ) -> Result<JsonValue, String>
地理 以给定的经纬度为中心, 返回键包含的位置元素当中, 与中心的距离不超过给定最大距离的所有位置元素
Source§fn stream_add(
&mut self,
key: &str,
msg_id: &str,
field: &str,
value: JsonValue,
) -> Result<String, String>
fn stream_add( &mut self, key: &str, msg_id: &str, field: &str, value: JsonValue, ) -> Result<String, String>
设置消息队列
fn stream_get_stream(&mut self, key: &str) -> Result<JsonValue, String>
Source§fn stream_group_msg(
&mut self,
key: &str,
group: &str,
user: &str,
) -> Result<JsonValue, String>
fn stream_group_msg( &mut self, key: &str, group: &str, user: &str, ) -> Result<JsonValue, String>
删除 消费者
fn stream_group_add_user( &mut self, key: &str, group: &str, user: &str, ) -> Result<bool, String>
fn stream_group_del_user( &mut self, key: &str, group: &str, user: &str, ) -> Result<bool, String>
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more