pub struct FileCache { /* private fields */ }Expand description
Disk-backed LRU cache for IPFS content.
Implementations§
Source§impl FileCache
impl FileCache
Sourcepub fn new(dir: &Path, max_size: u64) -> Result<Self>
pub fn new(dir: &Path, max_size: u64) -> Result<Self>
Create a new cache at the given directory with a max size in bytes.
Sourcepub fn get(&mut self, cid: &str) -> Option<Vec<u8>>
pub fn get(&mut self, cid: &str) -> Option<Vec<u8>>
Get cached content by CID. Returns None on miss.
Auto Trait Implementations§
impl Freeze for FileCache
impl RefUnwindSafe for FileCache
impl Send for FileCache
impl Sync for FileCache
impl Unpin for FileCache
impl UnsafeUnpin for FileCache
impl UnwindSafe for FileCache
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