Lines Matching full:unaligned
34 //! ## [`Unaligned`] destination types
36 //! For [`Unaligned`] destination types, alignment errors are impossible. All
38 //! [`From`] so long as `Dst: Unaligned`. For example, see [`<SizeError as
130 use crate::{util::SendSyncPhantomData, KnownLayout, TryFromBytes, Unaligned};
164 impl<Src, Dst: ?Sized + Unaligned, S, V> From<ConvertError<AlignmentError<Src, Dst>, S, V>>
168 /// `Dst` is unaligned.
170 /// Since [`Dst: Unaligned`], it is impossible to encounter an alignment
174 /// [`Dst: Unaligned`]: crate::Unaligned
183 /// #[derive(TryFromBytes, KnownLayout, Unaligned, Immutable)]
193 /// // Since `Bools: Unaligned`, we can infallibly discard
294 /// let unaligned = Unalign::new(0u16);
296 /// // Attempt to deref `unaligned`. This might fail with an alignment error.
297 /// let maybe_n: Result<&u16, AlignmentError<&Unalign<u16>, u16>> = unaligned.try_deref();
360 impl<Src, Dst: ?Sized + Unaligned> From<AlignmentError<Src, Dst>> for Infallible {
365 // Unaligned`, which means that its alignment requirement is equal to in from()
812 impl<Src, Dst: ?Sized + Unaligned> From<CastError<Src, Dst>> for SizeError<Src, Dst> {
814 /// is unaligned.
816 /// Since [`Dst: Unaligned`], it is impossible to encounter an alignment
821 /// [`Dst: Unaligned`]: crate::Unaligned
829 /// #[derive(FromBytes, IntoBytes, KnownLayout, Immutable, Unaligned)]
838 /// #[derive(FromBytes, IntoBytes, KnownLayout, Immutable, Unaligned)]
847 /// // Since `UdpPacket: Unaligned`, we can map the `CastError` to a `SizeError`.
1004 /// #[derive(TryFromBytes, KnownLayout, Unaligned, Immutable)]
1014 /// // Since `Bools: Unaligned`, we can infallibly discard
1235 // u8 is Unaligned in test_convert_error_from_unaligned()
1325 // u8 is Unaligned in test_convert_error_from_unaligned_variants()