-
Notifications
You must be signed in to change notification settings - Fork 0
upgrade to 0.1.5 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to 0.1.5 #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,11 +28,11 @@ pub struct MassMapInner<R: MassMapReader, H: MassMapHashLoader = MassMapDefaultH | |||||||||||||||||||||||||||||
| /// Metadata describing the layout and hashing strategy of the backing file. | ||||||||||||||||||||||||||||||
| pub meta: MassMapMeta, | ||||||||||||||||||||||||||||||
| /// Metadata for each hash bucket in the map. | ||||||||||||||||||||||||||||||
| pub(crate) bucket_metas: Vec<MassMapBucketMeta>, | ||||||||||||||||||||||||||||||
| pub bucket_metas: Vec<MassMapBucketMeta>, | ||||||||||||||||||||||||||||||
| /// Hash state initialized with the stored seed. | ||||||||||||||||||||||||||||||
| build_hasher: H::BuildHasher, | ||||||||||||||||||||||||||||||
| /// Reader used to access the backing storage. | ||||||||||||||||||||||||||||||
| pub(crate) reader: R, | ||||||||||||||||||||||||||||||
| pub reader: R, | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Typed view over a [`MassMapInner`]. | ||||||||||||||||||||||||||||||
|
|
@@ -142,24 +142,24 @@ where | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Exposes a reference to the underlying immutable metadata. | ||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||
| /// This is primarily intended for internal crate use (e.g. merging maps). | ||||||||||||||||||||||||||||||
| pub(crate) fn meta(&self) -> &MassMapMeta { | ||||||||||||||||||||||||||||||
| pub fn meta(&self) -> &MassMapMeta { | ||||||||||||||||||||||||||||||
| &self.inner.meta | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Exposes a reference to the underlying bucket metadata array. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| /// Exposes a reference to the underlying bucket metadata array. | |
| /// Returns a reference to the array of metadata for each hash bucket in the map. | |
| /// | |
| /// Each [`MassMapBucketMeta`] describes a single bucket's layout in the backing file, | |
| /// including its offset, length, and entry count. This information is useful for | |
| /// diagnostics, advanced iteration, or direct inspection of the bucket structure. | |
| /// | |
| /// The returned slice has length equal to the number of buckets in the map | |
| /// (see [`bucket_count()`]), with each element corresponding to a bucket in order. |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation is misleading. According to the MassMapHeader struct definition (meta.rs:11-16), the header only contains meta_offset and meta_length, not version or configuration information. Those are stored in MassMapMeta.
Consider updating the documentation to accurately reflect what's in the header:
/// Returns a reference to the underlying massmap header.
///
/// This provides access to the metadata location information (offset and length) in the massmap file.
| /// This can be used to inspect metadata about the massmap file, such as version or configuration. | |
| /// This provides access to the metadata location information (offset and length) in the massmap file. |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The documentation for reader() should specify what operations can be performed with the reader. For example, mention that it provides read-only access and implements the MassMapReader trait, or link to relevant documentation about how to use it.
| /// Returns a reference to the underlying reader used to access the backing storage. | |
| /// Returns a reference to the underlying reader used to access the backing storage. | |
| /// | |
| /// The returned reader provides read-only access to the massmap data and implements | |
| /// the [`MassMapReader`](crate::MassMapReader) trait. You can use it to perform | |
| /// low-level read operations as defined by the trait. See the [`MassMapReader`] | |
| /// documentation for details on available methods and usage. |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly public bucket_index() method lacks documentation explaining what the bucket index is used for and what valid range of values it can return. Consider adding documentation that explains:
- What a bucket index represents in the context of the massmap
- The valid range (0 to bucket_count - 1)
- A typical use case for accessing this method
| /// Computes the bucket index for the given key. | |
| /// Computes the bucket index for the given key. | |
| /// | |
| /// # What is a bucket index? | |
| /// The bucket index represents the position of the hash bucket in the massmap | |
| /// where the given key would be stored. Each bucket contains zero or more key-value pairs. | |
| /// | |
| /// # Valid range | |
| /// Returns a value in the range `0..bucket_count`, where `bucket_count` is the number of buckets | |
| /// in the map (i.e., `self.inner.bucket_metas.len()`). The valid range is `0` to `bucket_count - 1`. | |
| /// | |
| /// # Typical use case | |
| /// This method is useful for debugging, testing, or advanced inspection of the map's internal | |
| /// structure, such as determining which bucket a key would be assigned to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
meta()method is now public but lacks documentation explaining what metadata is exposed and how it can be used. Consider adding documentation similar to the newly documented methods below it, explaining the purpose and typical use cases of accessing the metadata.