pub(in crate) fn deserialize_from_snapshot(snapshot: &PathBuf, pass: &str) -> Client<Provider> {
    let mut buffer = Vec::new();

    let mut file = OpenOptions::new()
        .read(true)
        .open(snapshot)
        .expect("Unable to access snapshot. Make sure that it exists or run encrypt to build a new one.");

    decrypt_snapshot(&mut file, &mut buffer, pass.as_bytes()).expect("unable to decrypt the snapshot");

    let snap: Snapshot<Provider> = bincode::deserialize(&buffer[..]).expect("Unable to deserialize data");

    let (id, key) = snap.offload();

    Client::<Provider>::new(key, id)
}
// deserialize the snapshot data from the snapshot file.
deserialize the snapshot data from the snapshot file.
deserialize the snapshot data from the snapshot file .
pub(in crate) fn deserialize_from_snapshot(snapshot: &PathBuf, pass: &str) -> Client<Provider> {
    let mut buffer = Vec::new();
    let mut file = OpenOptions::new()
        .read(true)
        .open(snapshot)
        .expect("Unable to access snapshot. Make sure that it exists or run encrypt to build a new one.");
    decrypt_snapshot(&mut file, &mut buffer, pass.as_bytes()).expect("unable to decrypt the snapshot");
    let snap: Snapshot<Provider> = bincode::deserialize(&buffer[..]).expect("Unable to deserialize data");
    let (id, key) = snap.offload();
    Client::<Provider>::new(key, id)
}
pub ( in crate ) fn deserialize_from_snapshot ( snapshot : & PathBuf , pass : & str ) -> Client < Provider > { let mut buffer = Vec :: new ( ) ; let mut file = OpenOptions :: new ( ) . read ( true ) . open ( snapshot ) . expect ( " " ) ; decrypt_snapshot ( & mut file , & mut buffer , pass . as_bytes ( ) ) . expect ( " " ) ; let snap : Snapshot < Provider > = bincode :: deserialize ( & buffer [ .. ] ) . expect ( " " ) ; let ( id , key ) = snap . offload ( ) ; Client :: < Provider > :: new ( key , id ) }
deserialize the snapshot data from the snapshot file.
deserialize the snapshot data from the snapshot file .
snapshot
&PathBuf
pass
&str