pub struct Cache { /* private fields */ }Expand description
Handle to the on-disk cache directory.
Implementations§
Source§impl Cache
impl Cache
Sourcepub fn open(dir: Option<PathBuf>) -> Result<Self, RssError>
pub fn open(dir: Option<PathBuf>) -> Result<Self, RssError>
Open (creating if needed) the cache. If dir is None, use the OS cache dir
(~/Library/Caches/..., $XDG_CACHE_HOME/..., etc.) via the directories crate.
Sourcepub fn get(&self, feed_url: &str) -> Result<Option<CacheEntry>, RssError>
pub fn get(&self, feed_url: &str) -> Result<Option<CacheEntry>, RssError>
Read a cache entry for feed_url, if present and intact.
Sourcepub fn put(&self, meta: &CacheMeta, body: &[u8]) -> Result<(), RssError>
pub fn put(&self, meta: &CacheMeta, body: &[u8]) -> Result<(), RssError>
Atomically write a cache entry.
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 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