/// Extract a stable_memory.bin file.
///
/// This depends only on the stable memory using the `dfn_core::stable` library,
/// not on the actual data schema inside.
///
/// Returns the PathBuf to the extracted stable memory.


Returns the PathBuf to the extracted stable memory.
Returns the PathBuf to the extracted stable memory .
fn extract_stable_memory(
    args: &CliArgs,
    id: CanisterId,
    filename: &str,
) -> std::io::Result<PathBuf> {
    let encoded = args
        .input
        .join(hex::encode(id.get_ref().as_slice()))
        .join("stable_memory.bin");
    assert!(encoded.is_file(), "{} is not a file.", encoded.display());
    let decoded = args.output.join(filename);
    stable_reader::read(&mut File::open(encoded)?, File::create(decoded.clone())?)?;
    Ok(decoded)
}
fn extract_stable_memory ( args : & CliArgs , id : CanisterId , filename : & str , ) -> std :: io :: Result < PathBuf > { let encoded = args . input . join ( hex :: encode ( id . get_ref ( ) . as_slice ( ) ) ) . join ( " " ) ; assert ! ( encoded is_file ( ) " " encoded display ( ) ) ; let decoded = args . output . join ( filename ) ; stable_reader :: read ( & mut File :: open ( encoded ) ? , File :: create ( decoded . clone ( ) ) ? ) ? ; Ok ( decoded ) }
Extract a stable_memory.bin file.
Extract a stable_memory . bin file .
args
&CliArgs
id
CanisterId
filename
&str