NonNI128

Struct NonNI128 

Source
pub struct NonNI128<const N: i128>(/* private fields */);
Expand description

128-bit signed integer type that is known not to equal to any single value N.

This enables some memory layout optimization. For example, Option<NonNI128<N>> is the same size as i128:

use std::mem::size_of;
assert_eq!(size_of::<Option<NonNI128<42>>>(), size_of::<i128>());

§Layout

NonNI128\<N> is guaranteed to have the same layout and bit validity as i128 with the exception that N is not a valid instance. Option<NonNI128> is guaranteed to be compatible with i128, including in FFI.

Note that this does not mean you can transmute this type to get a i128 of the same value. If you need an i128 of the same value, use NonNI128::get instead.

Implementations§

Source§

impl<const N: i128> NonNI128<N>

Source

pub const MIN: Self

The smallest value that can be represented by this non-N integer type.

Source

pub const MAX: Self

The largest value that can be represented by this non-N integer type.

Source

pub const BITS: u32 = 128u32

The size of this non-N integer type in bits.

This value is equal to i128::BITS.

§Examples

assert_eq!(NonNI128::<42>::BITS, i128::BITS);
Source

pub const fn new(n: i128) -> Option<Self>

Creates a non-N if the given value is not N.

Source

pub const unsafe fn new_unchecked(n: i128) -> Self

Creates a NonNI128<N> without checking whether the value is non-N. This results in undefined behaviour if the value is N.

§Safety

The value must not be N.

Source

pub const fn get(self) -> i128

Returns the value as a primitive type.

Source

pub const fn cast<const M: i128>(self) -> Option<NonNI128<M>>

Returns a new NonNI128<M> with the current value if it is not M.

Source

pub const unsafe fn cast_unchecked<const M: i128>(self) -> NonNI128<M>

Returns a new NonNI128<M> with the current value without checking whether it is not M. This results in undefined behaviour if the current value is M.

§Safety

The current value must not be M.

Source

pub const fn leading_zeros(self) -> u32

Returns the number of leading zeros in the binary representation of self.

§Examples

Basic usage:

let n = NonNI128::<42>::new(-1i128).unwrap();

assert_eq!(n.leading_zeros(), 0);
Source

pub const fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation of self.

§Examples

Basic usage:

let n = NonNI128::<42>::new(0b0101000).unwrap();

assert_eq!(n.trailing_zeros(), 3);
Source

pub const fn checked_mul(self, other: Self) -> Option<Self>

Multiplies two non-N integers together. Checks for overflow and returns None on overflow.

§Examples
let two = NonNI128::<42>::new(2).unwrap();
let four = NonNI128::<42>::new(4).unwrap();
let max = NonNI128::<42>::new(i128::MAX).unwrap();

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
Source

pub const fn saturating_mul(self, other: Self) -> Self

Multiplies two non-N integers together. Return NonNI128::<42>::MAX on overflow.

§Examples
let two = NonNI128::<42>::new(2)?;
let four = NonNI128::<42>::new(4)?;
let max = NonNI128::<42>::new(i128::MAX)?;

assert_eq!(four, two.saturating_mul(two));
assert_eq!(max, four.saturating_mul(max));
Source

pub const fn checked_pow(self, other: u32) -> Option<Self>

Multiplies two non-N integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow even if the result would wrap to a non-N value. The behaviour is undefined as soon as self * rhs > i128::MAX, or self * rhs < i128::MIN. Raises non-N value to an integer power. Checks for overflow and returns None on overflow.

§Examples
let three = NonNI128::<42>::new(3)?;
let twenty_seven = NonNI128::<42>::new(27)?;
let half_max = NonNI128::<42>::new(i128::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
Source

pub const fn saturating_pow(self, other: u32) -> Self

Raise non-N value to an integer power. Return NonNI128::<42>::MIN or NonNI128::<42>::MAX on overflow.

§Examples
let three = NonNI128::<42>::new(3)?;
let twenty_seven = NonNI128::<42>::new(27)?;
let max = NonNI128::<42>::new(i128::MAX)?;

assert_eq!(twenty_seven, three.saturating_pow(3));
assert_eq!(max, max.saturating_pow(3));
Source

pub const fn abs(self) -> Self

Computes the absolute value of self. See i128::abs for documentation on overflow behaviour.

§Example
let pos = NonNI128::<42>::new(1)?;
let neg = NonNI128::<42>::new(-1)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
Source

pub const fn checked_abs(self) -> Option<Self>

Checked absolute value. Checks for overflow and returns None if self == NonNI128::MIN. The result cannot be N.

§Example
let pos = NonNI128::<42>::new(1)?;
let neg = NonNI128::<42>::new(-1)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
Source

pub const fn overflowing_abs(self) -> (Self, bool)

Computes the absolute value of self, with overflow information, see i128::overflowing_abs.

§Example
let pos = NonNI128::<42>::new(1)?;
let neg = NonNI128::<42>::new(-1)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
Source

pub const fn saturating_abs(self) -> Self

Saturating absolute value, see i128::saturating_abs.

§Example
let pos = NonNI128::<42>::new(1)?;
let neg = NonNI128::<42>::new(-1)?;
let min = NonNI128::<42>::new(i128::MIN)?;
let min_plus = NonNI128::<42>::new(i128::MIN + 1)?;
let max = NonNI128::<42>::new(i128::MAX)?;

assert_eq!(pos, pos.saturating_abs());
assert_eq!(pos, neg.saturating_abs());
assert_eq!(max, min.saturating_abs());
assert_eq!(max, min_plus.saturating_abs());
Source

pub const fn wrapping_abs(self) -> Self

Wrapping absolute value, see i128::wrapping_abs.

§Example
let pos = NonNI128::<42>::new(1)?;
let neg = NonNI128::<42>::new(-1)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
Source

pub const fn is_positive(self) -> bool

Returns true if self is positive and false if the number is negative.

§Example
let pos_five = NonNI128::<42>::new(5).unwrap();
let neg_five = NonNI128::<42>::new(-5).unwrap();

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
Source

pub const fn is_negative(self) -> bool

Returns true if self is negative and false if the number is positive.

§Example
let pos_five = NonNI128::<42>::new(5)?;
let neg_five = NonNI128::<42>::new(-5)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
Source

pub const fn checked_neg(self) -> Option<Self>

Checked negation. Computes -self, returning None if self == NonNI128::MIN.

§Example
let pos_five = NonNI128::<42>::new(5)?;
let neg_five = NonNI128::<42>::new(-5)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
Source

pub const fn overflowing_neg(self) -> (Self, bool)

Negates self, overflowing if this is equal to the minimum value.

See i128::overflowing_neg for documentation on overflow behaviour.

§Example
let pos_five = NonNI128::<42>::new(5)?;
let neg_five = NonNI128::<42>::new(-5)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
Source

pub const fn saturating_neg(self) -> Self

Saturating negation. Computes -self, returning NonNI128::<42>::MAX if self == NonNI128::<42>::MIN instead of overflowing.

§Example
let pos_five = NonNI128::<42>::new(5)?;
let neg_five = NonNI128::<42>::new(-5)?;
let min = NonNI128::<42>::new(i128::MIN)?;
let min_plus_one = NonNI128::<42>::new(i128::MIN + 1)?;
let max = NonNI128::<42>::new(i128::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
Source

pub const fn wrapping_neg(self) -> Self

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type.

See i128::wrapping_neg for documentation on overflow behaviour.

§Example
let pos_five = NonNI128::<42>::new(5)?;
let neg_five = NonNI128::<42>::new(-5)?;
let min = NonNI128::<42>::new(i128::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);

Trait Implementations§

Source§

impl<const N: i128, const M: i128> Add<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: NonNI128<M>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: i128> Add<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i128) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: i128, const M: i128> AddAssign<NonNI128<M>> for NonNI128<N>

Source§

fn add_assign(&mut self, rhs: NonNI128<M>)

Performs the += operation. Read more
Source§

impl<const N: i128> AddAssign<i128> for NonNI128<N>

Source§

fn add_assign(&mut self, rhs: i128)

Performs the += operation. Read more
Source§

impl<const N: i128> Binary for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128, const M: i128> BitAnd<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: NonNI128<M>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: i128> BitAnd<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: i128) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: i128, const M: i128> BitAndAssign<NonNI128<M>> for NonNI128<N>

Source§

fn bitand_assign(&mut self, rhs: NonNI128<M>)

Performs the &= operation. Read more
Source§

impl<const N: i128> BitAndAssign<i128> for NonNI128<N>

Source§

fn bitand_assign(&mut self, rhs: i128)

Performs the &= operation. Read more
Source§

impl<const N: i128, const M: i128> BitOr<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: NonNI128<M>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: i128> BitOr<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: i128) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: i128, const M: i128> BitOrAssign<NonNI128<M>> for NonNI128<N>

Source§

fn bitor_assign(&mut self, rhs: NonNI128<M>)

Performs the |= operation. Read more
Source§

impl<const N: i128> BitOrAssign<i128> for NonNI128<N>

Source§

fn bitor_assign(&mut self, rhs: i128)

Performs the |= operation. Read more
Source§

impl<const N: i128, const M: i128> BitXor<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: NonNI128<M>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: i128> BitXor<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: i128) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: i128, const M: i128> BitXorAssign<NonNI128<M>> for NonNI128<N>

Source§

fn bitxor_assign(&mut self, rhs: NonNI128<M>)

Performs the ^= operation. Read more
Source§

impl<const N: i128> BitXorAssign<i128> for NonNI128<N>

Source§

fn bitxor_assign(&mut self, rhs: i128)

Performs the ^= operation. Read more
Source§

impl<const N: i128> Clone for NonNI128<N>

Source§

fn clone(&self) -> NonNI128<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: i128> Debug for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128> Display for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128, const M: i128> Div<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonNI128<M>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: i128> Div<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i128) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: i128, const M: i128> DivAssign<NonNI128<M>> for NonNI128<N>

Source§

fn div_assign(&mut self, rhs: NonNI128<M>)

Performs the /= operation. Read more
Source§

impl<const N: i128> DivAssign<i128> for NonNI128<N>

Source§

fn div_assign(&mut self, rhs: i128)

Performs the /= operation. Read more
Source§

impl<const N: i128> From<NonNI128<N>> for i128

Source§

fn from(nonn: NonNI128<N>) -> Self

Converts a NonNI128 into an i128

Source§

impl<const N: i128> FromStr for NonNI128<N>

Source§

type Err = ParseIntError

The associated error which can be returned from parsing.
Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<const N: i128> Hash for NonNI128<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: i128> LowerHex for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128, const M: i128> Mul<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: NonNI128<M>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: i128> Mul<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i128) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: i128, const M: i128> MulAssign<NonNI128<M>> for NonNI128<N>

Source§

fn mul_assign(&mut self, rhs: NonNI128<M>)

Performs the *= operation. Read more
Source§

impl<const N: i128> MulAssign<i128> for NonNI128<N>

Source§

fn mul_assign(&mut self, rhs: i128)

Performs the *= operation. Read more
Source§

impl<const N: i128> Not for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<const N: i128> Octal for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128> Ord for NonNI128<N>

Source§

fn cmp(&self, other: &NonNI128<N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const N: i128> PartialEq for NonNI128<N>

Source§

fn eq(&self, other: &NonNI128<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: i128> PartialOrd for NonNI128<N>

Source§

fn partial_cmp(&self, other: &NonNI128<N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: i128, const M: i128> Rem<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonNI128<M>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: i128> Rem<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i128) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: i128, const M: i128> RemAssign<NonNI128<M>> for NonNI128<N>

Source§

fn rem_assign(&mut self, rhs: NonNI128<M>)

Performs the %= operation. Read more
Source§

impl<const N: i128> RemAssign<i128> for NonNI128<N>

Source§

fn rem_assign(&mut self, rhs: i128)

Performs the %= operation. Read more
Source§

impl<const N: i128, const M: i128> Shl<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: NonNI128<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: i128> Shl<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: i128, const M: i128> ShlAssign<NonNI128<M>> for NonNI128<N>

Source§

fn shl_assign(&mut self, rhs: NonNI128<M>)

Performs the <<= operation. Read more
Source§

impl<const N: i128> ShlAssign<i128> for NonNI128<N>

Source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
Source§

impl<const N: i128, const M: i128> Shr<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: NonNI128<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: i128> Shr<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: i128, const M: i128> ShrAssign<NonNI128<M>> for NonNI128<N>

Source§

fn shr_assign(&mut self, rhs: NonNI128<M>)

Performs the >>= operation. Read more
Source§

impl<const N: i128> ShrAssign<i128> for NonNI128<N>

Source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
Source§

impl<const N: i128, const M: i128> Sub<NonNI128<M>> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: NonNI128<M>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: i128> Sub<i128> for NonNI128<N>

Source§

type Output = NonNI128<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i128) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: i128, const M: i128> SubAssign<NonNI128<M>> for NonNI128<N>

Source§

fn sub_assign(&mut self, rhs: NonNI128<M>)

Performs the -= operation. Read more
Source§

impl<const N: i128> SubAssign<i128> for NonNI128<N>

Source§

fn sub_assign(&mut self, rhs: i128)

Performs the -= operation. Read more
Source§

impl<const N: i128> UpperHex for NonNI128<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: i128> Copy for NonNI128<N>

Source§

impl<const N: i128> Eq for NonNI128<N>

Source§

impl<const N: i128> StructuralPartialEq for NonNI128<N>

Auto Trait Implementations§

§

impl<const N: i128> Freeze for NonNI128<N>

§

impl<const N: i128> RefUnwindSafe for NonNI128<N>

§

impl<const N: i128> Send for NonNI128<N>

§

impl<const N: i128> Sync for NonNI128<N>

§

impl<const N: i128> Unpin for NonNI128<N>

§

impl<const N: i128> UnwindSafe for NonNI128<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.