• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Fuchsia Authors
2 //
3 // Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4 // <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6 // This file may not be copied, modified, or distributed except according to
7 // those terms.
8 
9 use zerocopy::{AsBytes, FromBytes, FromZeroes, KnownLayout};
10 
11 /// A type that doesn't implement any zerocopy traits.
12 pub struct NotZerocopy<T = ()>(T);
13 
14 /// A `u16` with alignment 2.
15 ///
16 /// Though `u16` has alignment 2 on some platforms, it's not guaranteed. By
17 /// contrast, `AU16` is guaranteed to have alignment 2.
18 #[derive(KnownLayout, FromZeroes, FromBytes, AsBytes, Copy, Clone)]
19 #[repr(C, align(2))]
20 pub struct AU16(u16);
21