rw-utils
Collection of utilities that enhance the rust Read and Write traits by providing various utility method for reading/writing structured data.
Utilities
- reading/writing of all rust integer types in little and big endian.
- reading/writing of vec/slice of all integer types in little and big endian.
- reading/writing of signed and unsigned leb128 in all/arbitrary sizes
- reading/writing of strings in various encodings
- Notable mention is a method for reading/writing a string compatible to java's DataInput/DataOutput readUTF/writeUTF methods.
Example
This example uses File for the implementation of Read or Write. You can do this with any impl of
these traits. Vec<u8>
/Cursor
/...
use io;
use NumRead;
use NumWrite;
Cargo features
To reduce "size" of the binary when using this library the default feature is empty. In order for this library to do anything you need to add at least 1 out of the following list of features:
- "num_read"
- "num_write"
- "string_read"
- "string_write"
- "leb128_read"
- "leb128_write"
- "to_write"
- "from_read"
If you want all features you can add the "all" feature.
Cargo.toml:
[]
= { = "*", = ["all"]}