Skip to main content

ChunkCacheConfig

Struct ChunkCacheConfig 

Source
pub struct ChunkCacheConfig { /* private fields */ }
Expand description

Configuration for a per-dataset chunk cache.

The byte and slot limits are the hdf5-pure counterpart of the rdcc_nbytes and rdcc_nslots raw-data chunk-cache settings from HDF5’s H5Pset_cache. They apply to decompressed raw chunk data. The optional chunk-index cache controls whether hdf5-pure retains the parsed chunk address index between reads of the same crate::Dataset. Disabling the index cache lowers retained metadata memory at the cost of re-scanning the on-disk chunk index for repeated reads.

Implementations§

Source§

impl ChunkCacheConfig

Source

pub const fn new() -> Self

Create a config matching the historical defaults: 1 MiB of decompressed chunks, 16 slots, and retained parsed chunk indexes.

Source

pub const fn from_h5p_cache(rdcc_nslots: usize, rdcc_nbytes: usize) -> Self

Create a config from HDF5 H5Pset_cache raw data chunk-cache values.

rdcc_nslots maps to the maximum retained chunk slots and rdcc_nbytes maps to the maximum retained decompressed chunk bytes. Modern HDF5 ignores H5Pset_cache’s mdc_nelmts; use crate::MetadataCacheConfig for the metadata-cache budget. The rdcc_w0 preemption policy has no direct equivalent because this read-only cache uses strict LRU eviction.

Source

pub const fn disabled() -> Self

Disable retained decompressed chunks and parsed chunk indexes.

Source

pub const fn with_max_bytes(self, max_bytes: usize) -> Self

Set the maximum decompressed chunk bytes retained per dataset.

Source

pub const fn with_max_slots(self, max_slots: usize) -> Self

Set the maximum number of decompressed chunk slots retained per dataset.

Source

pub const fn with_index_cache(self, enabled: bool) -> Self

Enable or disable retaining the parsed chunk index between reads.

Source

pub const fn max_bytes(&self) -> usize

Return the maximum decompressed chunk bytes retained per dataset.

Source

pub const fn max_slots(&self) -> usize

Return the maximum decompressed chunk slots retained per dataset.

Source

pub const fn index_cache_enabled(&self) -> bool

Return whether parsed chunk indexes are retained between reads.

Trait Implementations§

Source§

impl Clone for ChunkCacheConfig

Source§

fn clone(&self) -> ChunkCacheConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ChunkCacheConfig

Source§

impl Debug for ChunkCacheConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChunkCacheConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ChunkCacheConfig

Source§

impl PartialEq for ChunkCacheConfig

Source§

fn eq(&self, other: &ChunkCacheConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ChunkCacheConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.