#[repr(transparent)]pub struct NonZeroI32Inner(i32 is (..=0 | 1..=));🔬This is a nightly-only experimental API. (
temporary_niche_types)Tuple Fields§
§0: i32 is (..=0 | 1..=)🔬This is a nightly-only experimental API. (
temporary_niche_types)Implementations§
Source§impl NonZeroI32Inner
impl NonZeroI32Inner
pub const fn new(val: i32) -> Option<Self>
🔬This is a nightly-only experimental API. (
temporary_niche_types)Sourcepub const unsafe fn new_unchecked(val: i32) -> Self
🔬This is a nightly-only experimental API. (temporary_niche_types)
pub const unsafe fn new_unchecked(val: i32) -> 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) -> i32
🔬This is a nightly-only experimental API. (
temporary_niche_types)Trait Implementations§
Source§impl Clone for NonZeroI32Inner
impl Clone for NonZeroI32Inner
Source§fn clone(&self) -> NonZeroI32Inner
fn clone(&self) -> NonZeroI32Inner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)where
Self:,
fn clone_from(&mut self, source: &Self)where
Self:,
Performs copy-assignment from
source. Read moreimpl Copy for NonZeroI32Inner
Source§impl Debug for NonZeroI32Inner
impl Debug for NonZeroI32Inner
Source§impl Eq for NonZeroI32Inner
impl Eq for NonZeroI32Inner
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 NonZeroI32Inner
impl Hash for NonZeroI32Inner
Source§impl Ord for NonZeroI32Inner
impl Ord for NonZeroI32Inner
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
Source§impl PartialEq for NonZeroI32Inner
impl PartialEq for NonZeroI32Inner
Source§impl PartialOrd for NonZeroI32Inner
impl PartialOrd for NonZeroI32Inner
Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Source§#[doc(hidden)]fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)If
self == other, returns ControlFlow::Continue(()).
Otherwise, returns ControlFlow::Break(self < other). Read moreSource§#[doc(hidden)]fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as
__chaining_lt, but for <= instead of <.Source§#[doc(hidden)]fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as
__chaining_lt, but for > instead of <.Source§#[doc(hidden)]fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as
__chaining_lt, but for >= instead of <.impl StructuralPartialEq for NonZeroI32Inner
impl TrivialClone for NonZeroI32Inner
Auto Trait Implementations§
impl Freeze for NonZeroI32Inner
impl RefUnwindSafe for NonZeroI32Inner
impl Send for NonZeroI32Inner
impl Sync for NonZeroI32Inner
impl Unpin for NonZeroI32Inner
impl UnsafeUnpin for NonZeroI32Inner
impl UnwindSafe for NonZeroI32Inner
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> NonDrop for Twhere
T: Copy,
impl<T> Printable for T
Source§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. (
ptr_alignment_type #102070)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