#ipld #car #ipfs

rs-car-sync

Rust implementation of the CAR v1 and v2 specifications using standard sync api

1 unstable release

0.4.1 Dec 14, 2024

#705 in Filesystem

Download history 136/week @ 2024-12-11 29/week @ 2024-12-18 12/week @ 2024-12-25 16/week @ 2025-01-01 37/week @ 2025-01-08

101 downloads per month
Used in bluesky-firehose-stream

MIT/Apache

1.5MB
714 lines

rs-car-sync

This is a fork of rs-car that only uses standard sync rust api.

The main motivation is to get rid of useless contaminating async api when reading a car file from memory.

Rust implementation of the CAR specifications, both CARv1 and CARv2.

Usage

let mut file = std::fs::File::open(car_filepath).unwrap();
let block_iterator = decode_car_stream(&mut file, true).unwrap();

while let Some(item) = block_iterator.next() {
    let (cid, block) = item.unwrap();
    // Do something with CAR block
}

lib.rs:

Rust implementation of the CAR specifications, both CARv1 and CARv2.

Usage

  • To get a block iterator [CarReader::new()]
  • To read all blocks in memory [car_read_all]

Dependencies

~1.8–2.8MB
~55K SLoC