pub enum Cache {
Redis(Redis),
None,
}Variants§
Implementations§
Source§impl Cache
impl Cache
Sourcepub fn create(name: &str, connection: Connection) -> Self
pub fn create(name: &str, connection: Connection) -> Self
非配置文件模式
Sourcepub fn connections(&mut self) -> JsonValue
pub fn connections(&mut self) -> JsonValue
获取通道列表
Sourcepub fn connection(&mut self, name: &str) -> Self
pub fn connection(&mut self, name: &str) -> Self
切换通道
pub fn db(&mut self, db: i8) -> Result<&mut dyn CacheBase, String>
pub fn add( &mut self, key: &str, value: JsonValue, expiration_date: u64, ) -> Result<bool, String>
pub fn get(&mut self, key: &str) -> Result<JsonValue, String>
pub fn delete(&mut self, key: &str) -> Result<bool, String>
pub fn exists(&mut self, key: &str) -> Result<bool, String>
pub fn keys(&mut self, key: &str) -> Result<JsonValue, String>
pub fn set_add(&mut self, key: &str, value: JsonValue) -> Result<bool, String>
pub fn set_get(&mut self, key: &str) -> Result<JsonValue, String>
pub fn set_delete( &mut self, key: &str, value: JsonValue, ) -> Result<bool, String>
pub fn set_message_queue( &mut self, key: &str, value: JsonValue, ) -> Result<bool, String>
pub fn get_message_queue(&mut self, key: &str) -> Result<JsonValue, String>
pub fn set_object( &mut self, key: &str, field: &str, value: JsonValue, ) -> Result<bool, String>
Sourcepub fn add_hash(
&mut self,
key: &str,
field: &str,
value: JsonValue,
) -> Result<bool, String>
pub fn add_hash( &mut self, key: &str, field: &str, value: JsonValue, ) -> Result<bool, String>
哈希-添加
Trait Implementations§
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