pub enum CachePolicy {
Disabled,
Enabled {
entries: usize,
large_entries: usize,
large_bytes: usize,
},
}Expand description
How many parsed documents a table keeps in memory in front of its log — the read cache
crate::table::Table::get answers a repeated read from instead of re-reading and re-parsing
the line the registry points at.
Disabled is the default everywhere, including crate::database::OpenOptions: caching a
document is a memory bet a caller has to place on purpose.
Variants§
Disabled
Enabled
Implementations§
Source§impl CachePolicy
impl CachePolicy
Sourcepub fn with_entries(entries: usize) -> Self
pub fn with_entries(entries: usize) -> Self
entries small documents, an eighth as many large ones (never fewer than one) and
DEFAULT_LARGE_BYTES between the tiers — the shape for a caller who has a rough memory
budget rather than an opinion about tiers. 0 is CachePolicy::Disabled.
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CachePolicy
Source§impl Debug for CachePolicy
impl Debug for CachePolicy
Source§impl Default for CachePolicy
impl Default for CachePolicy
Source§fn default() -> CachePolicy
fn default() -> CachePolicy
Returns the “default value” for a type. Read more
impl Eq for CachePolicy
Source§impl PartialEq for CachePolicy
impl PartialEq for CachePolicy
impl StructuralPartialEq for CachePolicy
Auto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnsafeUnpin for CachePolicy
impl UnwindSafe for CachePolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.