pub struct MetadataCacheConfig { /* private fields */ }Expand description
Initial metadata-cache settings for streaming file access.
This is the hdf5-pure counterpart to the memory-budget portion of HDF5’s
H5Pset_mdc_config: it bounds the bytes retained for parsed metadata reads
while a file is opened through crate::File::open_streaming_with_options.
Raw dataset payload reads use Source::read_exact_at and are not
admitted to this cache.
Implementations§
Source§impl MetadataCacheConfig
impl MetadataCacheConfig
Sourcepub const fn new(max_bytes: usize) -> Self
pub const fn new(max_bytes: usize) -> Self
Create a metadata cache with the given total byte budget.
Individual cached reads are capped at
DEFAULT_METADATA_CACHE_MAX_ENTRY_BYTES (64 KiB) by default so one large
heap or index block cannot monopolize the cache. Use
with_max_entry_bytes to change that.
Sourcepub const fn with_max_entry_bytes(self, max_entry_bytes: usize) -> Self
pub const fn with_max_entry_bytes(self, max_entry_bytes: usize) -> Self
Set the maximum size of a single metadata read admitted to the cache.
Sourcepub const fn max_entry_bytes(&self) -> usize
pub const fn max_entry_bytes(&self) -> usize
Return the maximum size of one cached metadata entry.
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Whether metadata read caching is enabled.
Trait Implementations§
Source§impl Clone for MetadataCacheConfig
impl Clone for MetadataCacheConfig
Source§fn clone(&self) -> MetadataCacheConfig
fn clone(&self) -> MetadataCacheConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MetadataCacheConfig
Source§impl Debug for MetadataCacheConfig
impl Debug for MetadataCacheConfig
Source§impl Default for MetadataCacheConfig
impl Default for MetadataCacheConfig
impl Eq for MetadataCacheConfig
Source§impl PartialEq for MetadataCacheConfig
impl PartialEq for MetadataCacheConfig
impl StructuralPartialEq for MetadataCacheConfig
Auto Trait Implementations§
impl Freeze for MetadataCacheConfig
impl RefUnwindSafe for MetadataCacheConfig
impl Send for MetadataCacheConfig
impl Sync for MetadataCacheConfig
impl Unpin for MetadataCacheConfig
impl UnsafeUnpin for MetadataCacheConfig
impl UnwindSafe for MetadataCacheConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more