pub struct CacheStore { /* private fields */ }Expand description
SQLite-backed document cache.
Implementations§
Source§impl CacheStore
impl CacheStore
pub fn open(path: &Path) -> Result<Self>
pub fn set_ttl(&mut self, secs: i64)
pub fn get(&self, id: &str) -> Result<Option<String>>
pub fn get_by_category(&self, category: &str) -> Result<Vec<String>>
pub fn put( &self, id: &str, category: &str, name: &str, data: &str, ) -> Result<()>
pub fn bulk_put( &mut self, docs: &[(String, String, String, String)], ) -> Result<usize>
Sourcepub fn get_by_name(
&self,
name: &str,
category: Option<&str>,
) -> Result<Vec<String>>
pub fn get_by_name( &self, name: &str, category: Option<&str>, ) -> Result<Vec<String>>
Look up documents by name (case-insensitive), optionally scoped to a category.
Sourcepub fn purge_expired(&self) -> Result<usize>
pub fn purge_expired(&self) -> Result<usize>
Delete expired documents from the cache.
pub fn status(&self) -> Result<Vec<(String, i64)>>
Auto Trait Implementations§
impl !Freeze for CacheStore
impl !RefUnwindSafe for CacheStore
impl !Sync for CacheStore
impl !UnwindSafe for CacheStore
impl Send for CacheStore
impl Unpin for CacheStore
impl UnsafeUnpin for CacheStore
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