bra 0.1.1

Buffered random access to sequential data sources
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 27.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.75 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Enet4/bra-rs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Enet4

BRA

Latest Version Build Status dependency status Minimum Rust Version 1.31

Buffered Random Access (BRA) provides easy random memory access to a sequential source of data in Rust. This is achieved by greedily retaining all memory read from a given source.

Example

Please see the documentation for additional info.

use std::io::Read;
use bra::GreedyAccessReader;

let reader = get_reader();
let mut reader = GreedyAccessReader::new(reader);

// random access to bytes!
let k: u8 = reader.get(12)?;
// random slicing!
let s: &[u8] = reader.slice(20..48)?;
assert_eq!(s.len(), 28);
// also functions as a buffered reader
let mut chunk = [0; 20];
reader.read_exact(&mut chunk)?;

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.