Trait BytewiseEq
pub(crate) unsafe trait BytewiseEq<Rhs = Self>: ~const PartialEq<Rhs> + Sized
Types where == & != are equivalent to comparing their underlying bytes.
Importantly, this means no floating-point types, as those have different
byte representations (like -0 and +0) which compare as the same.
Since byte arrays are Eq, that implies that these types are probably also
Eq, but that's not technically required to use this trait.
Rhs is de facto always Self, but the separate parameter is important
to avoid the specializing impl repeats parameter error when consuming this.
Safety
SelfandRhshave no padding.SelfandRhshave the same layout (size and alignment).- Neither
SelfnorRhshave provenance, so integer comparisons are correct. <Self as PartialEq<Rhs>>::{eq,ne}are equivalent to comparing the bytes.
Implementors
impl BytewiseEq for Charimpl BytewiseEq for NonZero<i128>impl BytewiseEq for NonZero<i16>impl BytewiseEq for NonZero<i32>impl BytewiseEq for NonZero<i64>impl BytewiseEq for NonZero<i8>impl BytewiseEq for NonZero<isize>impl BytewiseEq for NonZero<u128>impl BytewiseEq for NonZero<u16>impl BytewiseEq for NonZero<u32>impl BytewiseEq for NonZero<u64>impl BytewiseEq for NonZero<u8>impl BytewiseEq for NonZero<usize>impl BytewiseEq for Option<NonZero<i128>>impl BytewiseEq for Option<NonZero<i16>>impl BytewiseEq for Option<NonZero<i32>>impl BytewiseEq for Option<NonZero<i64>>impl BytewiseEq for Option<NonZero<i8>>impl BytewiseEq for Option<NonZero<isize>>impl BytewiseEq for Option<NonZero<u128>>impl BytewiseEq for Option<NonZero<u16>>impl BytewiseEq for Option<NonZero<u32>>impl BytewiseEq for Option<NonZero<u64>>impl BytewiseEq for Option<NonZero<u8>>impl BytewiseEq for Option<NonZero<usize>>impl BytewiseEq for Orderingimpl BytewiseEq for boolimpl BytewiseEq for charimpl BytewiseEq for i128impl BytewiseEq for i16impl BytewiseEq for i32impl BytewiseEq for i64impl BytewiseEq for i8impl BytewiseEq for isizeimpl BytewiseEq for u128impl BytewiseEq for u16impl BytewiseEq for u32impl BytewiseEq for u64impl BytewiseEq for u8impl BytewiseEq for usizeimpl<T: BytewiseEq<U>, U> BytewiseEq<[U; 0]> for [T; 0]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 12]> for [T; 12]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 16]> for [T; 16]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 1]> for [T; 1]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 24]> for [T; 24]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 2]> for [T; 2]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 32]> for [T; 32]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 3]> for [T; 3]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 48]> for [T; 48]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 4]> for [T; 4]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 64]> for [T; 64]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 6]> for [T; 6]impl<T: BytewiseEq<U>, U> BytewiseEq<[U; 8]> for [T; 8]