- Added support for HDF5 1.10.5 with bindings for new functions.
File::access_plist()
orFile::fapl()
to get file access plist.File::create_plist()
orFile::fcpl()
to get file creation plist.- Added high-level wrappers for dataset access H5P API (
plist::DatasetAccess
). - Added
hdf5::is_library_threadsafe()
function.
- Changed
File
constructors, getting rid of string access modes:File::open(path, "r")
is nowFile::open(path)
File::open(path, "r+")
is nowFile::open_rw(path)
File::open(path, "w")
is nowFile::create(path)
File::open(path, "x" | "w-")
is nowFile::create_excl(path)
File::open(path, "a")
is nowFile::append(path)
- Also added
File::open_as(path, mode)
which accepts the mode enum. - Rewritten
FileBuilder
: it no longer accepts userblock, driver etc; all of these parameters can be set in the corresponding FAPL / FCPL:FileBuilder::set_access_plist()
orFileBuilder::set_fapl()
to set the active file access plist to a given one.FileBuilder::access_plist()
orFileBuilder::fapl()
to get a mutable reference to the FAPL builder - any parameter of it can then be tweaked as desired.FileBuilder::with_access_plist()
orFileBuilder::with_fapl()
to get access to the FAPL builder in an inline way via a closure.- Same as the three above for
create_plist
/fcpl
.
- As a result, all of the newly added FAPL / FCPL functionality is
fully accessible in the new
FileBuilder
. Also, driver strings are gone, everything is strongly typed now. - It's no longer prohibited to set FCPL options when opening a file and not creating it -- it will simply be silently ignored (this simplifies the behavior and allows using a single file builder).
- Added an explicit
hdf5_types::string::StringError
error type, as a resulterror-chain
dependency has been dropped. hdf5::Error
is now convertible fromndarray::ShapeError
;hdf5::ResultExt
trait has been removed.- Renamed
hdf5::hdf5_version()
tohdf5::library_version()
.
- Replaced deprecated
std::mem::uninitialized
withstd::mem::MaybeUninit
.
- Allow chunk dimensions to exceed dataset dimensions for resizable datasets.
- Default HDF5 location should now be detected automatically on Fedora Linux.
- Added
Group::link_exists()
. - Re-export
silence_errors()
at the crate root. - Added
from_id()
unsafe method at the crate root.
- Using
#[derive(H5Type)]
no longer requires addinghdf5-types
as a dependency.
- Added support for HDF5 1.10.
- Added Rust equivalents of HDF5 primitives: arrays, Unicode strings and ASCII strings – all of
them available in both fixed-size or variable-length flavours (
hdf5-types
crate). - Added
H5Type
trait that unifies the types that can be handled by the HDF5 library. This trait is implemented by default for all scalar types, tuples, fixed-size arrays and all types inhdf5-types
and can be used to createDatatype
objects. - Implemented
#[derive(H5Type)]
proc macro that allows for seamless mapping of user-defined structs and enums to their HDF5 counterparts. - Added high-level wrappers for file-creation H5P API (
plist::FileCreate
) and file-access H5P API (plist::FileAccess
), covering almost the entirety of FCPL and FAPL property list functionality. - Various improvements and additions to
PropertyList
type. - Added support for various file drivers (sec2/stdio/core/family/multi/split/log).
- Added support for MPIO driver (HDF5 has to be built with H5_HAVE_PARALLEL and the crate has to be built with "mpio" feature enabled).
- Added support for direct VFD driver (HDF5 has to be built with H5_HAVE_DIRECT).
- Added some missing bindings to
hdf5-sys
: driver-related FAPL bindings in h5p/h5fd (including MPIO and direct VFD drivers), MPIO bindings in h5p/h5f/h5fd. - Added core reading/writing API in
Container
, with support for reading/writing scalars, 1-d, 2-d, and dynamic-dimensional arrays, and raw slices. As a side effect, the main crate now depends onndarray
.Dataset
now dereferences toContainer
. - Added basic support for reading and writing dataset slices.
- When creating datasets, in-memory type layouts are normalized (converted to C repr).
- Added
packed
option toDatasetBuilder
(for creating packed HDF5 datasets). - All high-level objects now implement
Clone
(shallow copy, increases refcount).
- Renamed
hdf5-rs
crate (importable ash5
) tohdf5
(importable simply ashdf5
). - Renamed
libhdf5-sys
crate tohdf5-sys
(importable ashdf5_sys
). - Renamed GitHub repository to
aldanor/hdf5-rust
. - Updated the bindings and tests to the latest HDF5 versions (1.10.4 and 1.8.21).
- The build system has been reworked from the ground up:
hdf5-lib
crate has been removed; all of the build-time logic now resides in the build script ofhdf5-sys
.- The environment variables the build script reacts to are now
HDF5_DIR
andHDF5_VERSION
. pkg-config
is now only launched on Linux.- On macOS, the build scripts detects Homebrew installations, for both 1.8 and 1.10 versions.
- On Windows, we now scan the registry to detect official system-wide installations.
- Dynamic linking now works with conda envs;
HDF5_DIR
can be now pointed to a conda env. - A few definitions from
H5pubconf.h
are now exposed as cfg definitions, likeh5_have_parallel
,h5_have_threadsafe
andh5_have_direct
(this requires us to locate the include folder and parse the header at build time).
- Various clean ups in
hdf5-sys
: implementedDefault
andClone
where applicable, moved a few types and methods to matching parent modules. - Major refactor: trait-based type hierarchy has been replaced with a
Deref
-based hierarchy instead (53eff4f).ID
andFromID
traits have been removed. Traits likeLocation
,Object
and a few other have been replaced with real types (wrappers around HDF5 handles, same as the concrete types likeFile
). Subtypes then dereference into parent types, so the user can user methods of the parent type without having to import any traits into scope (for instance,File
dereferences intoGroup
, which dereferences intoLocation
, which dereferences intoObject
). - Dataspaces and property lists can now be copied via
.copy()
method (instead of.clone()
).
hbool_t
is now mapped to unsigned integer of proper size (either 1 byte or 4 bytes), depending on how the HDF5 library was built and on which platform.- Added missing bindings for previous versions (mostly in
h5p
andh5fd
modules). - Querying the HDF5 error stack is now thread-safe.
- Error silencing (
silence_errors()
) is now thread-safe. - Fixed wrong bindings for
H5AC_cache_config_t
.
- Removed
hdf5-lib
crate (merged it intohdf5-sys
, see above). - Removed
remutex
crate, using locking primitives fromparking_lot
crate instead. Container
trait has been removed, all of its functionality merged intoGroup
type.
- The version number jump is due to renaming crates
hdf5-rs
andlibhdf5-sys
tohdf5
andhdf5-sys
, respectively. Since there were already published crates with those names and the crates registry is meant to be immutable even if the crates are yanked, we had to bump the version so that it shadows all of the older versions.
- Full support of
msvc
target on Windows. CI tests on AppVeyor now use official reeases of HDF5 binaries (1.8.16, VS2015, x86_x64). Thegnu
target are still unofficially supported but won't be tested. - If
HDF5_LIBDIR
is not specified when building on Windows andPATH
contains what looks like thebin
folder of HDF5 installation, the library directory will be inferred automatically. The official HDF5 installers add thebin
folder to user path, so the official MSVC releases should just work out of the box without having to set any environment variables. - The library is now split into three crates:
hdf5-lib
(requests linkage to HDF5),hdf5-sys
(contains bindings, requireshdf5-lib
at build time in order to conditionally enable or disable certain HDF5 functionality), andhdf5
(the user-facing crate, requires both lower-level crates at build time). - Added
hdf5::hdf5_version
function. - The minimum required version of the HDF5 library is now 1.8.4.
- Both
hdf5-sys
andhdf5
crates can now use version attributes at compile time to enable/disable/change functionality. All functions and definitions that appeared in HDF5 versions past 1.8.4 are now conditionally enabled inhdf5-sys
. - Added bindings for HDF5 functions that were added in releases 1.8.15 and 1.8.16.
- Static global variables in HDF5 (H5E, H5P, H5T) are now linked based on HDF5 version and not
the target platform (
_ID_g
variables were introduced in 1.8.14). Whenmsvc
target is used, the dllimport stub prefixes are also accounted for. The constants exposed byhdf5-sys
are now of reference type and need to be dereferenced upon use (formsvc
, they have to be dereferenced twice).
- API simplification: many methods previously expecting
Into<String>
inputs now just take&str
. util::to_cstring
now takesBorrow<str>
instead ofInto<String>
so as to avoid unnecessary allocations, and the return value is now wrapped inResult
so that interior null bytes in input strings trigger an error.
- Fixed dangling pointer problems when strings were being passed as pointers to the C API.
- Fixed target path not being passed correctly in
Container::link_soft
.
Initial public version.