buf-view
A utility library to read and write primitive types on a wrapped buffer.
usage
To use buf-view, first add this to your Cargo.toml:
[]
= "0.1.0"
BufView
Wrap a buffer to read only.
use BufView;
let buf = ;
let mut buf_view = wrap;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// wrap from vector
let v = vec!;
let mut buf_view = wrap;
assert_eq!;
assert_eq!;
// wrap from &str
let s = "01234567";
let mut buf_view = wrap;
assert_eq!;
assert_eq!;
BufViewMut
Wrap a buffer to read and write.
use BufViewMut;
let mut buf = ;
let mut buf_view = wrap;
buf_view.write_u8;
buf_view.write_u16;
buf_view.write_u32;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
License
This project is licensed under the MIT license.
Contribution
All contributions are welcomed!