pub struct FileHashTable { /* private fields */ }Expand description
A hash lookup table backed by a file of known field names
Implementations§
Source§impl FileHashTable
impl FileHashTable
Sourcepub fn new(algorithm: HashAlgorithm) -> Self
pub fn new(algorithm: HashAlgorithm) -> Self
Sourcepub fn from_file<P: AsRef<Path>>(
algorithm: HashAlgorithm,
path: P,
) -> Result<Self>
pub fn from_file<P: AsRef<Path>>( algorithm: HashAlgorithm, path: P, ) -> Result<Self>
Create a new hash table with the given algorithm and lookup file
The lookup file should contain one field name per line Lines starting with ‘#’ are treated as comments
§Arguments
algorithm- The hash algorithm to use for calculating hashespath- The path to the lookup file containing field names
§Types
P- A type that can be converted to aPathreference, such as&strorString
§Errors
- If the file cannot be opened, a
JMapError::LookupFileNotFounderror is returned with the file path
§Returns
A Result containing the new FileHashTable instance if successful, or a JMapError if the file cannot be read
Sourcepub fn algorithm(&self) -> HashAlgorithm
pub fn algorithm(&self) -> HashAlgorithm
Get the hash algorithm used by this table
§Returns
The HashAlgorithm instance representing the hash algorithm used by this FileHashTable
Trait Implementations§
Source§impl Clone for FileHashTable
impl Clone for FileHashTable
Source§fn clone(&self) -> FileHashTable
fn clone(&self) -> FileHashTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileHashTable
impl Debug for FileHashTable
Source§impl HashTable for FileHashTable
Implementation of the HashTable trait for FileHashTable
This allows FileHashTable to be used wherever a HashTable is expected, providing methods to calculate hashes, find field names by hash, and add new field names to the lookup table
impl HashTable for FileHashTable
Implementation of the HashTable trait for FileHashTable
This allows FileHashTable to be used wherever a HashTable is expected, providing methods to calculate hashes, find field names by hash, and add new field names to the lookup table
Auto Trait Implementations§
impl Freeze for FileHashTable
impl RefUnwindSafe for FileHashTable
impl Send for FileHashTable
impl Sync for FileHashTable
impl Unpin for FileHashTable
impl UnwindSafe for FileHashTable
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