Crates.io | primitive-archiver |
lib.rs | primitive-archiver |
version | |
source | src |
created_at | 2025-02-08 19:19:51.494768+00 |
updated_at | 2025-02-08 19:19:51.494768+00 |
description | Primitive archiver |
homepage | https://github.com/yhdgms1/primitive-archiver |
repository | https://github.com/yhdgms1/primitive-archiver |
max_upload_size | |
id | 1548326 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
It structures data in a repeating sequence for each stored file
This format allows multiple files to be stored sequentially, even with identical filenames.
use primitive_archiver::{Archiver, Unarchiver};
#[tokio::main]
async fn main() {
let mut archiver = Archiver::new();
archiver.put("file.txt", Vec::from("Nothing makes sense anymore."));
archiver.put("some bytes", vec![1, 2, 3, 4, 5]);
archiver.end().await;
dbg!(archiver.bytes.clone());
let mut unarchiver = Unarchiver::new();
unarchiver.read(&mut archiver.bytes).await;
dbg!(unarchiver.files);
}
put
method (sync) adds file data to an internal buffer.end
method (async) finalizes the archive by compressing and appending data to the internal BytesMut buffer.Result
instead of silently discarding files