pub struct HashFinder { /* private fields */ }Expand description
Config for hash finding
To optimize performance if many hashes are looked up, use
HashFinder::find_sha256 method instead of find_sha256.
Implementations§
Source§impl HashFinder
impl HashFinder
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Initialize HashFinder
This function reads the hashfindutils config for future use.
§Errors
This function returns an error if the config couldn’t be read.
Sourcepub fn find_sha256(&self, hash: [u8; 32]) -> Result<Vec<PathBuf>, Error>
pub fn find_sha256(&self, hash: [u8; 32]) -> Result<Vec<PathBuf>, Error>
Find path from SHA-256 hash
This function finds the path(s) of the file(s) that have the given hash. Please note that this API is not yet stable.
§Errors
If one of the files couldn’t be read or the database version is not supported an error is returned.
Auto Trait Implementations§
impl Freeze for HashFinder
impl RefUnwindSafe for HashFinder
impl Send for HashFinder
impl Sync for HashFinder
impl Unpin for HashFinder
impl UnwindSafe for HashFinder
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