pub struct Cache { /* private fields */ }Expand description
Cache, in which blocks or blobs are cached in-memory after being retrieved from disk
This speeds up consecutive queries to nearby data, improving read performance for hot data.
§Examples
Sharing cache between multiple trees
// Provide 64 MB of cache capacity
let cache = Arc::new(Cache::with_capacity_bytes(64 * 1_000 * 1_000));
let tree1 = Config::new(folder, Default::default(), Default::default()).use_cache(cache.clone()).open()?;
let tree2 = Config::new(folder, Default::default(), Default::default()).use_cache(cache.clone()).open()?;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