bytecord 0.0.2

A byte reading-building utility library
Documentation
  • Coverage
  • 100%
    26 out of 26 items documented3 out of 60 items with examples
  • Size
  • Source code size: 75.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.35 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • iizudev/bytecord
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iizudev

Usage

Add this library to your project by:

cargo add bytecord

Example

reading:

use bytecord::ByteCord;

let data = vec![0u8; 1024];
let cord = ByteCord::new(data);

// Read with 4-byte alignment
let mut reader = cord.read_with_alignment(4);
let a = cord.next_be_u32().unwrap();
let b = cord.next_n(a).unwrap();

building:

use bytecord::ByteCordBuilder;

// a new builer with alignment of 1 byte (meaning no alignment)
let mut data = ByteCordBuilder::new(1);
data.append_le_u32(1111);
data.append_u8(1);
data.append_le_i64(-3919);
let slice = data.into_boxed_slice();

License

This project is dual-licensed under: