T-Bytes
T-Bytes is a tiny library for reading and writing typed data into bytes buffers. It is designed mainly for no-std
,
no-alloc
targets or crates which consider to support no-std
.
Documentation can be found here.
Installation
cargo add tbytes
Usage
It would be easier to start from an example. Here we create a buffer and populate it with heterogeneous values.
use TBytesError;
use ;
See examples for advanced usage.
Examples
basic
— basic read/write.cargo run --example basic
Limitations
We want to keep as simple as possible but simplicity comes with a price.
- At the moment only
little endian
is supported. - We currently supports only numeric types and arrays of such types. But you can always
implement your own
TBytesReaderFor
/TBytesWriterFor
. Or even better, submit a pull request!
License
Here we simply comply with the suggested dual licensing according to Rust API Guidelines (C-PERMISSIVE).
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
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.