pub enum Cache {
Redis(Redis),
None,
}Variants§
Implementations§
Trait Implementations§
source§impl CacheBase for Cache
impl CacheBase for Cache
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>
设置缓存
- key
- value
- expiration_date 过期时间 秒
source§fn get_message_queue(&mut self, key: &str) -> JsonValue
fn get_message_queue(&mut self, key: &str) -> JsonValue
获取消息队列
source§fn get_object(&mut self, key: &str) -> JsonValue
fn get_object(&mut self, key: &str) -> JsonValue
获取哈希值
fn set_object(&mut self, key: &str, field: &str, value: JsonValue) -> bool
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)