pod 0.3.1

Plain Old Data (POD) encoding and I/O
docs.rs failed to build pod-0.3.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: pod-0.5.0

Provides traits that assist with I/O and byte slice conversions involving Plain Old Data.

Safety

The nue-macros crate can be used for safe automagic derives.

Example

use pod::{Pod, Le, Be};
# #[cfg(not(feature = "unstable"))]
# mod stable {
# use pod::packed::{Unaligned, Packed};
# unsafe impl Packed for super::Data { }
# unsafe impl Unaligned for super::Data { }
# }

unsafe impl Pod for Data { }

#[repr(C)]
struct Data(u8, Le<u16>, Be<u32>);

# fn main() {
let data = Data(1, Le::new(0x2055), Be::new(0xdeadbeef));

let cmp = &[
    0x01,
    0x55, 0x20,
    0xde, 0xad, 0xbe, 0xef,
];

assert_eq!(cmp, data.as_slice());
# }