Skip to content

Commit

Permalink
[WIP] FromZeroes
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
joshlf committed Nov 10, 2022
1 parent 44af56d commit 0266efe
Show file tree
Hide file tree
Showing 6 changed files with 374 additions and 234 deletions.
6 changes: 3 additions & 3 deletions src/byteorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
//! UDP:
//!
//! ```edition2021
//! use zerocopy::{AsBytes, ByteSlice, FromBytes, LayoutVerified, Unaligned};
//! use zerocopy::{AsBytes, ByteSlice, FromBytes, FromZeroes, LayoutVerified, Unaligned};
//! use zerocopy::byteorder::network_endian::U16;
//!
//! #[derive(FromBytes, AsBytes, Unaligned)]
//! #[derive(FromZeroes, FromBytes, AsBytes, Unaligned)]
//! #[repr(C)]
//! struct UdpHeader {
//! src_port: U16,
Expand Down Expand Up @@ -179,7 +179,7 @@ example of how it can be used for parsing UDP packets.
[`FromBytes`]: crate::FromBytes
[`AsBytes`]: crate::AsBytes
[`Unaligned`]: crate::Unaligned"),
#[derive(FromBytes, AsBytes, Unaligned, Copy, Clone, Eq, PartialEq, Hash)]
#[derive(FromZeroes, FromBytes, AsBytes, Unaligned, Copy, Clone, Eq, PartialEq, Hash)]
#[repr(transparent)]
pub struct $name<O>([u8; $bytes], PhantomData<O>);
}
Expand Down
Loading

0 comments on commit 0266efe

Please sign in to comment.