DataView
The Pod
trait marks that it is safe to transmute between any bit pattern and an instance of the type.
The DataView
struct provides methods to read and write pod types into the buffer.
Library
This library is available on crates.io.
Documentation can be found on docs.rs.
In your Cargo.toml, put
[dependencies]
dataview = "0.1"
Examples
use Pod;
// Construct a zero initialized instance.
let mut inst = zeroed;
assert_eq!;
// Use the DataView interface to access the instance.
inst.as_data_view_mut.write;
// Returns a byte view over the instance.
assert_eq!;
License
Licensed under MIT License, see license.txt.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.