MassMapHashLoader

Trait MassMapHashLoader 

Source
pub trait MassMapHashLoader {
    type BuildHasher: BuildHasher;

    // Required method
    fn load(config: &MassMapHashConfig) -> Result<Self::BuildHasher>;
}
Expand description

Trait for loading a hash function configuration for use in a massmap.

Implement this trait to provide custom hash function support for massmaps. Implementors should ensure that the returned BuildHasher is constructed according to the provided MassMapHashConfig. The name field in the config should match the hash function supported by the implementation. This trait is intended for users who wish to plug in their own hash functions or parameterizations.

Required Associated Types§

Required Methods§

Source

fn load(config: &MassMapHashConfig) -> Result<Self::BuildHasher>

Loads a hash function from the given configuration.

§Parameters
  • config: The hash function configuration to load. The name field must match the supported hash function, and the parameters field must contain all required parameters.
§Returns

Returns a BuildHasher instance configured as specified.

§Errors

Returns an error if the name does not match the supported hash function, or if required parameters are missing or invalid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§