pub struct Db { /* private fields */ }Implementations§
Source§impl Db
impl Db
pub fn new() -> Db
pub fn get(&self, key: &str) -> Option<Bytes>
pub fn set(&self, key: String, value: Bytes, expire: Option<Duration>)
pub fn subscribe(&self, key: String) -> Receiver<Bytes>
pub fn publish(&self, key: &str, value: Bytes) -> usize
pub fn dump(&self) -> SerializableState
pub fn load(&self, serializable_state: SerializableState)
pub async fn dump_to(&self, path: &PathBuf) -> Result<()>
pub async fn load_from(&self, path: &PathBuf) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Db
impl RefUnwindSafe for Db
impl Send for Db
impl Sync for Db
impl Unpin for Db
impl UnwindSafe for Db
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