pub enum Cache {
Redis(Redis),
None,
}Variants§
Implementations§
source§impl Cache
impl Cache
pub fn db(&mut self, db: i8) -> &mut Self
pub fn set(&mut self, key: &str, value: JsonValue, time: usize) -> bool
pub fn get(&mut self, key: &str) -> JsonValue
sourcepub fn set_message_queue(&mut self, key: &str, value: JsonValue) -> bool
pub fn set_message_queue(&mut self, key: &str, value: JsonValue) -> bool
设置消息队列
sourcepub fn get_message_queue(&mut self, key: &str) -> JsonValue
pub fn get_message_queue(&mut self, key: &str) -> JsonValue
获取消息队列
pub fn set_object(&mut self, key: &str, field: &str, value: JsonValue) -> bool
sourcepub fn get_object(&mut self, key: &str) -> JsonValue
pub fn get_object(&mut self, key: &str) -> JsonValue
获取哈希值
Trait Implementations§
Auto Trait Implementations§
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