#[repr(transparent)]pub struct Cmp<T>(pub T);Expand description
∧ ≤ 🛠️
Provides comparing methods for T.
This wrapper exposes comparison operations as value methods, enabling uniform and const-evaluable comparisons across primitives.
It provides the non-const methods pclamp, pmax, pmin
for comparing PartialOrdered values.
It provides the following const methods for comparing primitives:
clamp, max, min, eq, ne, lt, le, gt, ge.
It also allows compile-time comparison between Orderings.
In the case of floating-point primitives:
- total ordering is used.
- additional methods are provided:
is_positive,is_negative,is_finite,is_infinite,is_nan.
See also the cmp! macro for an operation-first syntax.
Tuple Fields§
§0: TImplementations§
Source§impl<T: PartialOrd> Cmp<T>
impl<T: PartialOrd> Cmp<T>
Sourcepub fn pclamp(self, min: T, max: T) -> Option<T> ⓘ
pub fn pclamp(self, min: T, max: T) -> Option<T> ⓘ
Compares and returns a PartialOrdered value clamped between min and max.
Returns None if comparisons are indeterminate.
§Examples
assert_eq![Some(0.4), Cmp(1.0).pclamp(0.2, 0.4)];
assert_eq![Some(0.2), Cmp(0.0).pclamp(0.2, 0.4)];
//
assert_eq![None, Cmp(1.0).pclamp(f32::NAN, f32::NAN)];
assert_eq![None, Cmp(1.0).pclamp(f32::NAN, 0.4)];
assert_eq![None, Cmp(1.0).pclamp(0.2, f32::NAN)];Sourcepub fn pmax(self, other: T) -> Option<T> ⓘ
pub fn pmax(self, other: T) -> Option<T> ⓘ
Compares and returns the maximum of two PartialOrdered values.
Returns None if comparisons are indeterminate.
Complements core::cmp::max which requires Ord
§Examples
assert_eq![Some(0.4), Cmp(0.2).pmax(0.4)];
//
assert_eq![None, Cmp(0.2).pmax(f32::NAN)];
assert_eq![None, Cmp(f32::NAN).pmax(0.4)];Sourcepub fn pmin(self, other: T) -> Option<T> ⓘ
pub fn pmin(self, other: T) -> Option<T> ⓘ
Compares and returns the minimum of two PartialOrdered values.
Returns None if comparisons are indeterminate.
Complements core::cmp::min which requires Ord
§Examples
assert_eq![Some(0.2), Cmp(0.2).pmin(0.4)];
//
assert_eq![None, Cmp(0.2).pmin(f32::NAN)];
assert_eq![None, Cmp(f32::NAN).pmin(0.4)];Sourcepub fn pminmax(self, other: T) -> Option<(T, T)> ⓘ
pub fn pminmax(self, other: T) -> Option<(T, T)> ⓘ
Compares, orders, and returns both (minimum, maximum) PartialOrdered values.
Returns None if comparisons are indeterminate.
§Examples
assert_eq![Some((0.2, 0.4)), Cmp(0.4).pminmax(0.2)];
//
assert_eq![None, Cmp(0.2).pminmax(f32::NAN)];
assert_eq![None, Cmp(f32::NAN).pminmax(0.4)];Source§impl Cmp<u8>
impl Cmp<u8>
Sourcepub const fn total_cmp(self, other: u8) -> Ordering
pub const fn total_cmp(self, other: u8) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: u8, max: u8) -> u8
pub const fn clamp(self, min: u8, max: u8) -> u8
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: u8) -> u8
pub const fn max(self, other: u8) -> u8
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: u8) -> u8
pub const fn min(self, other: u8) -> u8
Compares and returns the minimum between self and other.
Source§impl Cmp<u16>
impl Cmp<u16>
Sourcepub const fn total_cmp(self, other: u16) -> Ordering
pub const fn total_cmp(self, other: u16) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: u16, max: u16) -> u16
pub const fn clamp(self, min: u16, max: u16) -> u16
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: u16) -> u16
pub const fn max(self, other: u16) -> u16
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: u16) -> u16
pub const fn min(self, other: u16) -> u16
Compares and returns the minimum between self and other.
Source§impl Cmp<u32>
impl Cmp<u32>
Sourcepub const fn total_cmp(self, other: u32) -> Ordering
pub const fn total_cmp(self, other: u32) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: u32, max: u32) -> u32
pub const fn clamp(self, min: u32, max: u32) -> u32
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: u32) -> u32
pub const fn max(self, other: u32) -> u32
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: u32) -> u32
pub const fn min(self, other: u32) -> u32
Compares and returns the minimum between self and other.
Source§impl Cmp<u64>
impl Cmp<u64>
Sourcepub const fn total_cmp(self, other: u64) -> Ordering
pub const fn total_cmp(self, other: u64) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: u64, max: u64) -> u64
pub const fn clamp(self, min: u64, max: u64) -> u64
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: u64) -> u64
pub const fn max(self, other: u64) -> u64
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: u64) -> u64
pub const fn min(self, other: u64) -> u64
Compares and returns the minimum between self and other.
Source§impl Cmp<u128>
impl Cmp<u128>
Sourcepub const fn total_cmp(self, other: u128) -> Ordering
pub const fn total_cmp(self, other: u128) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: u128, max: u128) -> u128
pub const fn clamp(self, min: u128, max: u128) -> u128
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: u128) -> u128
pub const fn max(self, other: u128) -> u128
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: u128) -> u128
pub const fn min(self, other: u128) -> u128
Compares and returns the minimum between self and other.
Source§impl Cmp<usize>
impl Cmp<usize>
Sourcepub const fn total_cmp(self, other: usize) -> Ordering
pub const fn total_cmp(self, other: usize) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: usize, max: usize) -> usize
pub const fn clamp(self, min: usize, max: usize) -> usize
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: usize) -> usize
pub const fn max(self, other: usize) -> usize
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: usize) -> usize
pub const fn min(self, other: usize) -> usize
Compares and returns the minimum between self and other.
Source§impl Cmp<i8>
impl Cmp<i8>
Sourcepub const fn total_cmp(self, other: i8) -> Ordering
pub const fn total_cmp(self, other: i8) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: i8, max: i8) -> i8
pub const fn clamp(self, min: i8, max: i8) -> i8
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: i8) -> i8
pub const fn max(self, other: i8) -> i8
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: i8) -> i8
pub const fn min(self, other: i8) -> i8
Compares and returns the minimum between self and other.
Source§impl Cmp<i16>
impl Cmp<i16>
Sourcepub const fn total_cmp(self, other: i16) -> Ordering
pub const fn total_cmp(self, other: i16) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: i16, max: i16) -> i16
pub const fn clamp(self, min: i16, max: i16) -> i16
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: i16) -> i16
pub const fn max(self, other: i16) -> i16
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: i16) -> i16
pub const fn min(self, other: i16) -> i16
Compares and returns the minimum between self and other.
Source§impl Cmp<i32>
impl Cmp<i32>
Sourcepub const fn total_cmp(self, other: i32) -> Ordering
pub const fn total_cmp(self, other: i32) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: i32, max: i32) -> i32
pub const fn clamp(self, min: i32, max: i32) -> i32
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: i32) -> i32
pub const fn max(self, other: i32) -> i32
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: i32) -> i32
pub const fn min(self, other: i32) -> i32
Compares and returns the minimum between self and other.
Source§impl Cmp<i64>
impl Cmp<i64>
Sourcepub const fn total_cmp(self, other: i64) -> Ordering
pub const fn total_cmp(self, other: i64) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: i64, max: i64) -> i64
pub const fn clamp(self, min: i64, max: i64) -> i64
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: i64) -> i64
pub const fn max(self, other: i64) -> i64
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: i64) -> i64
pub const fn min(self, other: i64) -> i64
Compares and returns the minimum between self and other.
Source§impl Cmp<i128>
impl Cmp<i128>
Sourcepub const fn total_cmp(self, other: i128) -> Ordering
pub const fn total_cmp(self, other: i128) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: i128, max: i128) -> i128
pub const fn clamp(self, min: i128, max: i128) -> i128
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: i128) -> i128
pub const fn max(self, other: i128) -> i128
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: i128) -> i128
pub const fn min(self, other: i128) -> i128
Compares and returns the minimum between self and other.
Source§impl Cmp<isize>
impl Cmp<isize>
Sourcepub const fn total_cmp(self, other: isize) -> Ordering
pub const fn total_cmp(self, other: isize) -> Ordering
Compares self and other using total order.
For integer types, ordering is already total; this method exists for consistency with floating-point comparisons.
Sourcepub const fn clamp(self, min: isize, max: isize) -> isize
pub const fn clamp(self, min: isize, max: isize) -> isize
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: isize) -> isize
pub const fn max(self, other: isize) -> isize
Compares and returns the maximum between self and other.
Sourcepub const fn min(self, other: isize) -> isize
pub const fn min(self, other: isize) -> isize
Compares and returns the minimum between self and other.
Source§impl Cmp<f32>
impl Cmp<f32>
Sourcepub const fn clamp(self, min: f32, max: f32) -> f32
pub const fn clamp(self, min: f32, max: f32) -> f32
Compares and returns a clamped total ordered self between min and max.
§Examples
assert_eq![2.0, Cmp(5.0f32).clamp(-1.0, 2.0)];
assert_eq![-1.0, Cmp(-5.0f32).clamp(-1.0, 2.0)];Sourcepub const fn max(self, other: f32) -> f32
pub const fn max(self, other: f32) -> f32
Compares and returns the total ordered maximum between self and other.
§Examples
assert_eq![2.0, Cmp(2.0f32).max(-1.0)];
assert_eq![2.0, Cmp(1.0f32).max(2.0)];
assert_eq![0.0, Cmp(-0.0f32).max(0.0)];
assert_eq![f32::INFINITY, Cmp(f32::INFINITY).max(f32::NEG_INFINITY)];Sourcepub const fn min(self, other: f32) -> f32
pub const fn min(self, other: f32) -> f32
Compares and returns the total ordered minimum between self and other.
§Examples
assert_eq![-1.0, Cmp(2.0f32).min(-1.0)];
assert_eq![1.0, Cmp(1.0f32).min(2.0)];
assert_eq![-0.0, Cmp(-0.0f32).min(0.0)];
assert_eq![f32::NEG_INFINITY, Cmp(f32::INFINITY).min(f32::NEG_INFINITY)];Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if self is sign positive.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if self is sign negative.
Sourcepub const fn is_infinite(self) -> bool
pub const fn is_infinite(self) -> bool
Returns true if self is infinite (either negative or positive).
Sourcepub const fn is_subnormal(self) -> bool
pub const fn is_subnormal(self) -> bool
Returns true if self is subnormal.
Source§impl Cmp<f64>
impl Cmp<f64>
Sourcepub const fn clamp(self, min: f64, max: f64) -> f64
pub const fn clamp(self, min: f64, max: f64) -> f64
Compares and returns a clamped total ordered self between min and max.
§Examples
assert_eq![2.0, Cmp(5.0f64).clamp(-1.0, 2.0)];
assert_eq![-1.0, Cmp(-5.0f64).clamp(-1.0, 2.0)];Sourcepub const fn max(self, other: f64) -> f64
pub const fn max(self, other: f64) -> f64
Compares and returns the total ordered maximum between self and other.
§Examples
assert_eq![2.0, Cmp(2.0f64).max(-1.0)];
assert_eq![2.0, Cmp(1.0f64).max(2.0)];
assert_eq![0.0, Cmp(-0.0f64).max(0.0)];
assert_eq![f64::INFINITY, Cmp(f64::INFINITY).max(f64::NEG_INFINITY)];Sourcepub const fn min(self, other: f64) -> f64
pub const fn min(self, other: f64) -> f64
Compares and returns the total ordered minimum between self and other.
§Examples
assert_eq![-1.0, Cmp(2.0f64).min(-1.0)];
assert_eq![1.0, Cmp(1.0f64).min(2.0)];
assert_eq![-0.0, Cmp(-0.0f64).min(0.0)];
assert_eq![f64::NEG_INFINITY, Cmp(f64::INFINITY).min(f64::NEG_INFINITY)];Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if self is sign positive.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if self is sign negative.
Sourcepub const fn is_infinite(self) -> bool
pub const fn is_infinite(self) -> bool
Returns true if self is infinite (either negative or positive).
Sourcepub const fn is_subnormal(self) -> bool
pub const fn is_subnormal(self) -> bool
Returns true if self is subnormal.
Source§impl Cmp<f16>
impl Cmp<f16>
Sourcepub const fn clamp(self, min: f16, max: f16) -> f16
pub const fn clamp(self, min: f16, max: f16) -> f16
Compares and returns a clamped total ordered self between min and max.
§Examples
assert_eq![2.0, Cmp(5.0f16).clamp(-1.0, 2.0)];
assert_eq![-1.0, Cmp(-5.0f16).clamp(-1.0, 2.0)];Sourcepub const fn max(self, other: f16) -> f16
pub const fn max(self, other: f16) -> f16
Compares and returns the total ordered maximum between self and other.
§Examples
assert_eq![2.0, Cmp(2.0f16).max(-1.0)];
assert_eq![2.0, Cmp(1.0f16).max(2.0)];
assert_eq![0.0, Cmp(-0.0f16).max(0.0)];
assert_eq![f16::INFINITY, Cmp(f16::INFINITY).max(f16::NEG_INFINITY)];Sourcepub const fn min(self, other: f16) -> f16
pub const fn min(self, other: f16) -> f16
Compares and returns the total ordered minimum between self and other.
§Examples
assert_eq![-1.0, Cmp(2.0f16).min(-1.0)];
assert_eq![1.0, Cmp(1.0f16).min(2.0)];
assert_eq![-0.0, Cmp(-0.0f16).min(0.0)];
assert_eq![f16::NEG_INFINITY, Cmp(f16::INFINITY).min(f16::NEG_INFINITY)];Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if self is sign positive.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if self is sign negative.
Sourcepub const fn is_infinite(self) -> bool
pub const fn is_infinite(self) -> bool
Returns true if self is infinite (either negative or positive).
Sourcepub const fn is_subnormal(self) -> bool
pub const fn is_subnormal(self) -> bool
Returns true if self is subnormal.
Source§impl Cmp<f128>
impl Cmp<f128>
Sourcepub const fn clamp(self, min: f128, max: f128) -> f128
pub const fn clamp(self, min: f128, max: f128) -> f128
Compares and returns a clamped total ordered self between min and max.
§Examples
assert_eq![2.0, Cmp(5.0f128).clamp(-1.0, 2.0)];
assert_eq![-1.0, Cmp(-5.0f128).clamp(-1.0, 2.0)];Sourcepub const fn max(self, other: f128) -> f128
pub const fn max(self, other: f128) -> f128
Compares and returns the total ordered maximum between self and other.
§Examples
assert_eq![2.0, Cmp(2.0f128).max(-1.0)];
assert_eq![2.0, Cmp(1.0f128).max(2.0)];
assert_eq![0.0, Cmp(-0.0f128).max(0.0)];
assert_eq![f128::INFINITY, Cmp(f128::INFINITY).max(f128::NEG_INFINITY)];Sourcepub const fn min(self, other: f128) -> f128
pub const fn min(self, other: f128) -> f128
Compares and returns the total ordered minimum between self and other.
§Examples
assert_eq![-1.0, Cmp(2.0f128).min(-1.0)];
assert_eq![1.0, Cmp(1.0f128).min(2.0)];
assert_eq![-0.0, Cmp(-0.0f128).min(0.0)];
assert_eq![f128::NEG_INFINITY, Cmp(f128::INFINITY).min(f128::NEG_INFINITY)];Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if self is sign positive.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if self is sign negative.
Sourcepub const fn is_infinite(self) -> bool
pub const fn is_infinite(self) -> bool
Returns true if self is infinite (either negative or positive).
Sourcepub const fn is_subnormal(self) -> bool
pub const fn is_subnormal(self) -> bool
Returns true if self is subnormal.
Source§impl Cmp<Ordering>
impl Cmp<Ordering>
Sourcepub const fn total_cmp(self, other: Ordering) -> Ordering
pub const fn total_cmp(self, other: Ordering) -> Ordering
Compares self and other using total order.
Ordering is already totally ordered as: Less < Equal < Greater.
Sourcepub const fn clamp(self, min: Ordering, max: Ordering) -> Ordering
pub const fn clamp(self, min: Ordering, max: Ordering) -> Ordering
Compares and returns self clamped between min and max.
Sourcepub const fn max(self, other: Ordering) -> Ordering
pub const fn max(self, other: Ordering) -> Ordering
Compares and returns the maximum between self and other.
Trait Implementations§
impl<T: Copy> Copy for Cmp<T>
impl<T: Eq> Eq for Cmp<T>
Source§impl<T: Ord> Ord for Cmp<T>
impl<T: Ord> Ord for Cmp<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialOrd> PartialOrd for Cmp<T>
impl<T: PartialOrd> PartialOrd for Cmp<T>
Auto Trait Implementations§
impl<T> Freeze for Cmp<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cmp<T>where
T: RefUnwindSafe,
impl<T> Send for Cmp<T>where
T: Send,
impl<T> Sync for Cmp<T>where
T: Sync,
impl<T> Unpin for Cmp<T>where
T: Unpin,
impl<T> UnsafeUnpin for Cmp<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Cmp<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice only.