pub struct MassMapInner<R: MassMapReader, H: MassMapHashLoader = MassMapDefaultHashLoader> {
pub header: MassMapHeader,
pub meta: MassMapMeta,
/* private fields */
}Expand description
Immutable hash map backed by a serialized massmap file.
A MassMap is created from a MassMapReader (typically a file) and
provides low-latency lookups without loading the whole dataset into memory.
Keys and values are deserialized on demand using serde and MessagePack.
§Type Parameters
K: key type stored in the map; must implementserde::Deserialize.V: value type stored in the map; must implementserde::DeserializeandClone.R: reader that satisfiesMassMapReader.H: hash loader used to reconstruct theBuildHasherfrom the persistedMassMapHashConfig.
Fields§
§header: MassMapHeaderHeader serialized at the start of the massmap file.
meta: MassMapMetaMetadata describing the layout and hashing strategy of the backing file.
Implementations§
Source§impl<R: MassMapReader, H: MassMapHashLoader> MassMapInner<R, H>
impl<R: MassMapReader, H: MassMapHashLoader> MassMapInner<R, H>
Sourcepub fn load(reader: R) -> Result<Self>
pub fn load(reader: R) -> Result<Self>
Constructs an untyped massmap from a MassMapReader implementation.
The method validates the leading header (magic number, metadata offset and
length) and deserializes MassMapMeta. Any IO or deserialization errors
are forwarded to the caller.
Sourcepub fn info(&self) -> MassMapInfo
pub fn info(&self) -> MassMapInfo
Returns information about the map’s structure and contents.
Trait Implementations§
Source§impl<R: Debug + MassMapReader, H: Debug + MassMapHashLoader> Debug for MassMapInner<R, H>where
H::BuildHasher: Debug,
impl<R: Debug + MassMapReader, H: Debug + MassMapHashLoader> Debug for MassMapInner<R, H>where
H::BuildHasher: Debug,
Auto Trait Implementations§
impl<R, H> Freeze for MassMapInner<R, H>
impl<R, H> RefUnwindSafe for MassMapInner<R, H>
impl<R, H> Send for MassMapInner<R, H>
impl<R, H> Sync for MassMapInner<R, H>
impl<R, H> Unpin for MassMapInner<R, H>
impl<R, H> UnwindSafe for MassMapInner<R, H>
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
Mutably borrows from an owned value. Read more