Bytey
Bytey provides a convenient and easy to use byte storage.
Documentation
A link to the documentation can be found here.
Installation
To start using this crate all you have to do is add it to your Cargo.toml:
[]
= "0.4.0"
Usage
use ByteBuffer;
Any value written to the ByteBuffer will have to implement the ByteBufferWrite trait.
By default, this trait is implemented on all numerical primitives(u8, u16, i8, i16, etc...).
Reading a type from the ByteBuffer requires that type to implement the ByteBufferRead trait,
this has also been implemented by default on all numeral primitives.
If you would like to see more default implementations of these traits let me know in an issue on GitHub!
Macros
Bytey comes with 2 derive macros with the same name as the traits ByteBufferWrite and ByteBufferRead
that you can use on your own structs and enums.
use ;
Keep in mind that all the fields inside the struct or enum must implement the trait as well, else you will get an error.
Contributing
Feel free to contribute by sending pull requests. For major changes or if you have an idea that could help improve Bytey, please open an issue!
Please make sure if you do contribute that tests are updated appropriately.