rust-car 0.1.4

This crate is the ipfs car file reader writer and utils.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use rust_car::reader;

/// e.g. ```cargo run --example ls file```
/// the example list file infomation in carv1-basic.car file
fn main() {
    let file_name = std::env::args().nth(1);
    let path = file_name.as_ref().map(|f| f.into()).unwrap_or_else(|| {
        let file = std::path::Path::new("test");
        file.join("carv1-basic.car")
    });
    let file = std::fs::File::open(path).unwrap();
    let mut reader = reader::new_v1(file).unwrap();
    rust_car::utils::list(&mut reader).unwrap();
}