pub struct Cache { /* private fields */ }Implementations§
Source§impl Cache
impl Cache
pub fn new() -> Result<Self>
pub fn generate_key( file_hash: Option<&str>, file_url: Option<&str>, endpoint: &str, params: &Value, ) -> String
pub fn hash_file(path: &PathBuf) -> Result<String>
pub fn get(&self, cache_key: &str) -> Option<Value>
pub fn set( &self, cache_key: &str, response: &Value, endpoint: &str, file_hash: Option<&str>, file_path: Option<&str>, ) -> Result<()>
pub fn save_binary(&self, file_hash: &str, data: &[u8]) -> Result<PathBuf>
pub fn clear(&self, older_than_days: Option<u64>) -> Result<ClearStats>
pub fn stats(&self) -> Result<CacheStats>
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin 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