pub struct FileAccessProperties { /* private fields */ }Expand description
File-access properties applied when opening an HDF5 file.
This is the hdf5-pure analogue of an HDF5 file access property list
(fapl): one value carrying every access-time setting, built once and passed
to whichever open a caller reaches for, exactly as a fapl is handed to
H5Fopen. Every *_with_options constructor on File accepts it, so a
read path and a read-write path can share one configuration.
The Properties suffix means the type stands in for one whole HDF5 property
list, so every setting on it has a C counterpart to look up. It is a stand-in
and not a port: a plain Copy value, with no handle to create or close, no
runtime property registry, and no setter that can fail. fapl and each
H5Pset_* it models are doc aliases, so a search for either lands here.
- The metadata cache (
H5Pset_mdc_config) applies to the streaming and bounded backends; an in-memory open already holds the whole file in one buffer. - The chunk cache (
H5Pset_cache) is the file-wide default for datasets opened from any backend, overridable per dataset withDatasetAccessProperties. - The locking policy (
H5Pset_file_locking) applies to the read-write opens. Readers and the SWMR writer take no lock by design, so they ignore it.
See the property-support reference for the full property-by-property map.
Implementations§
Source§impl FileAccessProperties
impl FileAccessProperties
Sourcepub const fn with_metadata_cache(
self,
metadata_cache: MetadataCacheConfig,
) -> Self
pub const fn with_metadata_cache( self, metadata_cache: MetadataCacheConfig, ) -> Self
Configure the bounded streaming metadata cache.
Sourcepub const fn with_chunk_cache(self, chunk_cache: ChunkCacheConfig) -> Self
pub const fn with_chunk_cache(self, chunk_cache: ChunkCacheConfig) -> Self
Configure the per-dataset raw chunk cache used by datasets opened from
this file. This is the H5Pset_cache-style file-wide default.
Sourcepub const fn with_locking(self, locking: FileLocking) -> Self
pub const fn with_locking(self, locking: FileLocking) -> Self
Set the OS advisory file-locking policy for the read-write opens.
Defaults to FileLocking::Enabled. Use FileLocking::Disabled only
when an external mechanism already guarantees single-writer access, or
FileLocking::BestEffort on a filesystem (such as some network mounts)
where the OS lock is unavailable. Setting HDF5_USE_FILE_LOCKING in the
environment overrides this, as in the C library.
Readers and File::open_swmr_writer take no lock by design and ignore
this.
Sourcepub const fn with_memory_strategy(self, memory_strategy: MemoryStrategy) -> Self
pub const fn with_memory_strategy(self, memory_strategy: MemoryStrategy) -> Self
Set how much memory a read-write open may use to hold the file.
Unset by default, which lets the entry point choose:
File::open_rw uses MemoryStrategy::Auto, preferring the bounded
engine and falling back to the whole-file mirror for a file it cannot
edit, while the deprecated File::open_rw_bounded uses
MemoryStrategy::Bounded, refusing such a file rather than quietly
spending O(file size) memory on a caller who asked not to. Setting this
overrides both, in either direction; MemoryStrategy::Mirrored takes
the whole-file mirror unconditionally, as open_rw did before it learned
to dispatch.
The read-only opens ignore this: they build no editing session at all, and
their own names say what memory they spend. File::open_swmr_writer
does build one, and always mirrors: it accepts
MemoryStrategy::Auto and MemoryStrategy::Mirrored, both of which
the mirror satisfies, and refuses an explicit MemoryStrategy::Bounded
with Error::EditUnsupported rather than quietly not honoring it. Ask a
File which backend it resolved to with File::edit_backing.
Sourcepub const fn metadata_cache(&self) -> MetadataCacheConfig
pub const fn metadata_cache(&self) -> MetadataCacheConfig
Return the configured streaming metadata cache.
Sourcepub const fn chunk_cache(&self) -> ChunkCacheConfig
pub const fn chunk_cache(&self) -> ChunkCacheConfig
Return the configured per-dataset chunk cache.
Sourcepub const fn locking(&self) -> FileLocking
pub const fn locking(&self) -> FileLocking
Return the configured file-locking policy.
Sourcepub const fn memory_strategy(&self) -> Option<MemoryStrategy>
pub const fn memory_strategy(&self) -> Option<MemoryStrategy>
Return the configured memory strategy, or None when none was asked for
and the entry point’s own default applies. This is what was requested;
for which backend an open resolved to, see File::edit_backing.
The Option exists so the deprecated File::open_rw_bounded can
default to MemoryStrategy::Bounded while File::open_rw defaults to
MemoryStrategy::Auto; when that pair is removed this should collapse to
a plain MemoryStrategy with Auto as the default, in that same release
rather than as a second break on this accessor.
Trait Implementations§
Source§impl Clone for FileAccessProperties
impl Clone for FileAccessProperties
Source§fn clone(&self) -> FileAccessProperties
fn clone(&self) -> FileAccessProperties
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 FileAccessProperties
Source§impl Debug for FileAccessProperties
impl Debug for FileAccessProperties
Source§impl Default for FileAccessProperties
impl Default for FileAccessProperties
Source§fn default() -> FileAccessProperties
fn default() -> FileAccessProperties
impl Eq for FileAccessProperties
Source§impl PartialEq for FileAccessProperties
impl PartialEq for FileAccessProperties
impl StructuralPartialEq for FileAccessProperties
Auto Trait Implementations§
impl Freeze for FileAccessProperties
impl RefUnwindSafe for FileAccessProperties
impl Send for FileAccessProperties
impl Sync for FileAccessProperties
impl Unpin for FileAccessProperties
impl UnsafeUnpin for FileAccessProperties
impl UnwindSafe for FileAccessProperties
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