Function dochy_archiver::get_hash_and_metadata_from_dir[][src]

pub fn get_hash_and_metadata_from_dir<P: AsRef<Path>>(
    dir_path: P,
    opt: &ArchiveOptions
) -> ArcResult<(u128, Metadata)>

Calculate the hash from the files in the directory.

To calculate the hash, this function constructs Metadata from the files, serializes the metadata, and applies the hash function to the serialized data.

This function returns the hash and the metadata.

use dochy_archiver::{get_hash_and_metadata_from_dir, ArchiveOptions, ArcResult};
fn main(){ fn2(); }
fn fn2() -> ArcResult<()>{
    let (hash, metadata) = get_hash_and_metadata_from_dir("foo/some_dir", &ArchiveOptions::new())?;
    Ok(())
}