#[repr(transparent)]pub struct NonZeroU16Inner(u16 is 1..=);🔬This is a nightly-only experimental API. (
temporary_niche_types)Tuple Fields§
§0: u16 is 1..=🔬This is a nightly-only experimental API. (
temporary_niche_types)Implementations§
Source§impl NonZeroU16Inner
impl NonZeroU16Inner
pub const fn new(val: u16) -> Option<Self>
🔬This is a nightly-only experimental API. (
temporary_niche_types)Sourcepub const unsafe fn new_unchecked(val: u16) -> Self
🔬This is a nightly-only experimental API. (temporary_niche_types)
pub const unsafe fn new_unchecked(val: u16) -> Self
temporary_niche_types)Constructs an instance of this type from the underlying integer primitive without checking whether its valid.
§Safety
Immediate language UB if val is not within the valid range for this
type, as it violates the validity invariant.
pub const fn as_inner(self) -> u16
🔬This is a nightly-only experimental API. (
temporary_niche_types)Trait Implementations§
Source§impl Clone for NonZeroU16Inner
impl Clone for NonZeroU16Inner
impl Copy for NonZeroU16Inner
Source§impl Debug for NonZeroU16Inner
impl Debug for NonZeroU16Inner
Source§impl Eq for NonZeroU16Inner
impl Eq for NonZeroU16Inner
1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
👎Deprecated since 1.95.0:
implementation detail of #[derive(Eq)]
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
🔬This is a nightly-only experimental API. (
derive_eq_internals)Source§impl Hash for NonZeroU16Inner
impl Hash for NonZeroU16Inner
Source§impl Ord for NonZeroU16Inner
impl Ord for NonZeroU16Inner
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for NonZeroU16Inner
impl PartialEq for NonZeroU16Inner
Source§impl PartialOrd for NonZeroU16Inner
impl PartialOrd for NonZeroU16Inner
Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Source§#[doc(hidden)]fn __chaining_less(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_less(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)If
self == other, returns Continue(()).
Otherwise, returns Break(self < other), or equivalently Break(self <= other).
The only difference when chaining < and <= is how an equality result is
interpreted at the end of the chain. Read moreSource§#[doc(hidden)]fn __chaining_greater(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_greater(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as
__chaining_less, but for >/>= instead of </<=.impl StructuralPartialEq for NonZeroU16Inner
impl TrivialClone for NonZeroU16Inner
Auto Trait Implementations§
impl Forget for NonZeroU16Inner
impl Freeze for NonZeroU16Inner
impl Move for NonZeroU16Inner
impl RefUnwindSafe for NonZeroU16Inner
impl Send for NonZeroU16Inner
impl Sync for NonZeroU16Inner
impl Unpin for NonZeroU16Inner
impl UnsafeUnpin for NonZeroU16Inner
impl UnwindSafe for NonZeroU16Inner
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Printable for T
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize
#[doc(hidden)]const SIZE: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize
#[doc(hidden)]const ALIGN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment
#[doc(hidden)]const ALIGNMENT: Alignment
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const IS_ZST: bool
#[doc(hidden)]const IS_ZST: bool
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout
#[doc(hidden)]const LAYOUT: Layout
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize
#[doc(hidden)]const MAX_SLICE_LEN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more