diff --git a/CHANGELOG.md b/CHANGELOG.md index df4fcf77..e73331fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#58](https://github.com/LDeakin/zarrs/pull/58) Add direct I/O support in `FilesystemStore` by [@sk1p] - Adds `FilesystemStoreOptions` and `FilesystemStore::new_with_options` - [#64](https://github.com/LDeakin/zarrs/pull/64) Add `Array::[async_]store_encoded_chunk` for writing already-encoded chunks by [@sk1p] + - Add `key()`, `start()`, `value()` to `StoreKeyStartValue` ### Changed - **Breaking**: `Arc` instead of `Box` partial decoders diff --git a/src/storage.rs b/src/storage.rs index 8464f825..55bf9759 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -165,11 +165,29 @@ impl StoreKeyStartValue<'_> { StoreKeyStartValue { key, start, value } } - /// Get the offset of exclusive end of the [`StoreKeyStartValue`]. + /// Get the key. + #[must_use] + pub fn key(&self) -> &StoreKey { + &self.key + } + + /// Get the offset of the start. + #[must_use] + pub const fn start(&self) -> ByteOffset { + self.start + } + + /// Get the offset of the exclusive end. #[must_use] pub const fn end(&self) -> ByteOffset { self.start + self.value.len() as u64 } + + /// Get the value. + #[must_use] + pub fn value(&self) -> &[u8] { + self.value + } } /// [`StoreKeys`] and [`StorePrefixes`].