Lines Matching full:unaligned

62 //! - [`Unaligned`] indicates that a type's alignment requirement is 1
1786 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
1792 /// [self-unaligned]: Unaligned
1907 /// If [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
1913 /// [self-unaligned]: Unaligned
2017 /// `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned], you
2023 /// [self-unaligned]: Unaligned
2127 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
2133 /// [self-unaligned]: Unaligned
2233 /// [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
2239 /// [self-unaligned]: Unaligned
2333 /// `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned], you
2339 /// [self-unaligned]: Unaligned
2431 /// of `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned],
2434 /// [self-unaligned]: Unaligned
2551 /// of `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned],
2554 /// [self-unaligned]: Unaligned
2659 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
2662 /// [self-unaligned]: Unaligned
2765 /// of `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned],
2768 /// [self-unaligned]: Unaligned
2874 /// of `Self`, this returns `Err`. If [`Self: Unaligned`][self-unaligned],
2877 /// [self-unaligned]: Unaligned
2974 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
2977 /// [self-unaligned]: Unaligned
3111 /// aligned reads (which carry a performance advantage over unaligned reads
3189 /// aligned reads (which carry a performance advantage over unaligned reads
3268 /// aligned reads (which carry a performance advantage over unaligned reads
4066 /// returns `Err`. If [`Self: Unaligned`][self-unaligned], you can
4072 /// [self-unaligned]: Unaligned
4174 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
4180 /// [self-unaligned]: Unaligned
4282 /// [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
4288 /// [self-unaligned]: Unaligned
4374 /// returns `Err`. If [`Self: Unaligned`][self-unaligned], you can
4380 /// [self-unaligned]: Unaligned
4464 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
4470 /// [self-unaligned]: Unaligned
4554 /// [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
4560 /// [self-unaligned]: Unaligned
4634 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
4637 /// [self-unaligned]: Unaligned
4731 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
4734 /// [self-unaligned]: Unaligned
4825 /// [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
4828 /// [self-unaligned]: Unaligned
4919 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
4922 /// [self-unaligned]: Unaligned
5005 /// Unaligned`][self-unaligned], you can [infallibly discard the alignment
5008 /// [self-unaligned]: Unaligned
5090 /// [`Self: Unaligned`][self-unaligned], you can [infallibly discard the
5093 /// [self-unaligned]: Unaligned
5605 /// - if the type is `repr(C)`, its fields must be [`Unaligned`].
6193 /// Analyzes whether a type is [`Unaligned`].
6196 /// the [safety conditions] of `Unaligned` and implements `Unaligned` if it is
6201 /// # use zerocopy_derive::Unaligned;
6202 /// #[derive(Unaligned)]
6210 /// #[derive(Unaligned)]
6219 /// #[derive(Unaligned)]
6232 /// determine whether it is sound to implement `Unaligned` for a given type.
6234 /// manually implement `Unaligned` for a type yourself, you don't need to read
6238 /// `Unaligned` for that type:
6243 /// [`Unaligned`].
6251 /// [safety conditions]: trait@Unaligned#safety
6254 pub use zerocopy_derive::Unaligned;
6258 /// If `T: Unaligned`, then `align_of::<T>() == 1`.
6263 /// [`#[derive(Unaligned)]`][derive]; e.g.:
6266 /// # use zerocopy_derive::Unaligned;
6267 /// #[derive(Unaligned)]
6275 /// #[derive(Unaligned)]
6284 /// #[derive(Unaligned)]
6295 /// determine whether a type is `Unaligned`.
6299 /// *This section describes what is required in order for `T: Unaligned`, and
6301 /// `Unaligned` manually, and you don't plan on writing unsafe code that
6302 /// operates on `Unaligned` types, then you don't need to read this section.*
6304 /// If `T: Unaligned`, then unsafe code may assume that it is sound to produce a
6306 /// is marked as `Unaligned` which violates this contract, it may cause
6309 /// `#[derive(Unaligned)]` only permits [types which satisfy these
6314 doc = "[derive]: zerocopy_derive::Unaligned",
6315 doc = "[derive-analysis]: zerocopy_derive::Unaligned#analysis"
6319 …derive]: https://docs.rs/zerocopy/", env!("CARGO_PKG_VERSION"), "/zerocopy/derive.Unaligned.html"),
6320 …https://docs.rs/zerocopy/", env!("CARGO_PKG_VERSION"), "/zerocopy/derive.Unaligned.html#analysis"),
6324 diagnostic::on_unimplemented(note = "Consider adding `#[derive(Unaligned)]` to `{Self}`")
6326 pub unsafe trait Unaligned { trait
6327 // The `Self: Sized` bound makes it so that `Unaligned` is still object
6479 #[derive(Debug, Eq, PartialEq, FromBytes, IntoBytes, Unaligned, Immutable)]
6942 fn _takes_unaligned(_: &dyn Unaligned) {} in test_object_safety() argument
7351 #[derive(IntoBytes, FromBytes, Unaligned)] in test_transparent_packed_generic_struct()
7360 assert_impl_all!(Foo<u8>: Unaligned); in test_transparent_packed_generic_struct()
7362 #[derive(IntoBytes, FromBytes, Unaligned)] in test_transparent_packed_generic_struct()
7370 assert_impl_all!(Bar<u8, AU64>: FromZeros, FromBytes, IntoBytes, Unaligned); in test_transparent_packed_generic_struct()