clawmates: phase work
Mission: 01a00c41-bac0-7eb3-a8c8-8b7044f3086d Phase: 01a00c41-bac2-71e3-a58b-c473421200ee Committed by the ClawMates delivery pipeline from the agents' working tree. Authored by agents, not by the named committer.
This commit is contained in:
@@ -30,7 +30,7 @@ name = "parallel_bench"
|
||||
harness = false
|
||||
|
||||
[features]
|
||||
default = ["mmap", "fast-deflate"]
|
||||
default = ["mmap", "fast-deflate", "provenance"]
|
||||
mmap = ["clawhdf5-io/mmap"]
|
||||
parallel = ["clawhdf5-format/parallel", "rayon"]
|
||||
fast-deflate = ["clawhdf5-format/fast-deflate"]
|
||||
@@ -39,6 +39,7 @@ zstd = ["clawhdf5-format/zstd"]
|
||||
blake3_hash = ["clawhdf5-format/blake3_hash"]
|
||||
lz4 = ["clawhdf5-format/lz4"]
|
||||
pcodec = ["clawhdf5-format/pcodec"]
|
||||
provenance = ["clawhdf5-format/provenance"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["mmap"]
|
||||
|
||||
@@ -426,6 +426,23 @@ impl<'f> Dataset<'f> {
|
||||
Ok(data_read::read_as_strings(&raw, &dt)?)
|
||||
}
|
||||
|
||||
/// Verify this dataset's SHINES provenance hash (the `_provenance_sha256`
|
||||
/// attribute written by [`clawhdf5_format::type_builders::DatasetBuilder::with_provenance`])
|
||||
/// against its actual stored bytes.
|
||||
///
|
||||
/// Returns [`clawhdf5_format::provenance::VerifyResult::NoHash`] if the
|
||||
/// dataset was never written with provenance metadata. Requires the
|
||||
/// `provenance` Cargo feature on `clawhdf5-format` (enabled by default).
|
||||
#[cfg(feature = "provenance")]
|
||||
pub fn verify_provenance(&self) -> Result<clawhdf5_format::provenance::VerifyResult, Error> {
|
||||
Ok(clawhdf5_format::provenance::verify_dataset(
|
||||
self.file.data.as_bytes(),
|
||||
&self.header,
|
||||
self.file.offset_size(),
|
||||
self.file.length_size(),
|
||||
)?)
|
||||
}
|
||||
|
||||
// ----- Selection-based read methods -----
|
||||
|
||||
/// Read selected elements as raw bytes.
|
||||
|
||||
Reference in New Issue
Block a user