Struct NonZero

1.79.0 ยท Source
#[repr(transparent)]
pub struct NonZero<T>(<T as ZeroablePrimitive>::NonZeroInner) where T: ZeroablePrimitive;
Expand description

A value that is known not to equal zero.

This enables some memory layout optimization. For example, Option<NonZero<u32>> is the same size as u32:

use core::{num::NonZero};

assert_eq!(size_of::<Option<NonZero<u32>>>(), size_of::<u32>());

ยงLayout

NonZero<T> is guaranteed to have the same layout and bit validity as T with the exception that the all-zero bit pattern is invalid. Option<NonZero<T>> is guaranteed to be compatible with T, including in FFI.

Thanks to the null pointer optimization, NonZero<T> and Option<NonZero<T>> are guaranteed to have the same size and alignment:

use std::num::NonZero;

assert_eq!(size_of::<NonZero<u32>>(), size_of::<Option<NonZero<u32>>>());
assert_eq!(align_of::<NonZero<u32>>(), align_of::<Option<NonZero<u32>>>());

ยงNote on generic usage

NonZero<T> can only be used with some standard library primitive types (such as u8, i32, and etc.). The type parameter T must implement the internal trait ZeroablePrimitive, which is currently permanently unstable and cannot be implemented by users. Therefore, you cannot use NonZero<T> with your own types, nor can you implement traits for all NonZero<T>, only for concrete types.

Tuple Fieldsยง

ยง0: <T as ZeroablePrimitive>::NonZeroInner

Implementationsยง

Sourceยง

impl<T> NonZero<T>

1.28.0 (const: 1.47.0) ยท Source

pub const fn new(n: T) -> Option<NonZero<T>>

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

1.28.0 (const: 1.28.0) ยท Source

pub const unsafe fn new_unchecked(n: T) -> NonZero<T>

Creates a non-zero without checking whether the value is non-zero. This results in undefined behavior if the value is zero.

ยงSafety

The value must not be zero.

Source

pub fn from_mut(n: &mut T) -> Option<&mut NonZero<T>>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_from_mut)

Converts a reference to a non-zero mutable reference if the referenced value is not zero.

Source

pub unsafe fn from_mut_unchecked(n: &mut T) -> &mut NonZero<T>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_from_mut)

Converts a mutable reference to a non-zero mutable reference without checking whether the referenced value is non-zero. This results in undefined behavior if the referenced value is zero.

ยงSafety

The referenced value must not be zero.

1.28.0 (const: 1.34.0) ยท Source

pub const fn get(self) -> T

Returns the contained value as a primitive type.

Sourceยง

impl NonZero<u8>

1.67.0 ยท Source

pub const BITS: u32 = 8u32

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

This value is equal to u8::BITS.

ยงExamples
assert_eq!(NonZero::<u8>::BITS, u8::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<u8>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<u8>::MIN.get(), 1u8);
1.70.0 ยท Source

pub const MAX: NonZero<u8>

The largest value that can be represented by this non-zero integer type, equal to u8::MAX.

ยงExamples
assert_eq!(NonZero::<u8>::MAX.get(), u8::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u8>::new(u8::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u8>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u8>::new(0b_01100100)?;
let b = NonZero::<u8>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u8>::new(0b_01100100)?;
let b = NonZero::<u8>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<u8>::new(0b100_0000)?;
let b = NonZero::<u8>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x82u8)?;
let m = NonZero::new(0xa)?;

assert_eq!(n.rotate_left(2), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xau8)?;
let m = NonZero::new(0x82)?;

assert_eq!(n.rotate_right(2), m);
Source

pub const fn swap_bytes(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12u8)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x12)?);
Source

pub const fn reverse_bits(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12u8)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x48)?);
Source

pub const fn from_be(x: NonZero<u8>) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU8;
let n = NonZero::new(0x1Au8)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroU8::from_be(n), n)
} else {
    assert_eq!(NonZeroU8::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<u8>) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU8;
let n = NonZero::new(0x1Au8)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroU8::from_le(n), n)
} else {
    assert_eq!(NonZeroU8::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au8)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au8)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: u8) -> Option<NonZero<u8>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1u8)?;
let two = NonZero::new(2u8)?;
let max = NonZero::new(u8::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: u8) -> NonZero<u8>

Adds an unsigned integer to a non-zero value. Return NonZero::<u8>::MAX on overflow.

ยงExamples
let one = NonZero::new(1u8)?;
let two = NonZero::new(2u8)?;
let max = NonZero::new(u8::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: u8) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > u8::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1u8)?;
let two = NonZero::new(2u8)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<u8>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u8)?;
let three = NonZero::new(3u8)?;
let four = NonZero::new(4u8)?;
let max = NonZero::new(u8::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as u8::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7u8)?.ilog2(), 2);
assert_eq!(NonZero::new(8u8)?.ilog2(), 3);
assert_eq!(NonZero::new(9u8)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as u8::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99u8)?.ilog10(), 1);
assert_eq!(NonZero::new(100u8)?.ilog10(), 2);
assert_eq!(NonZero::new(101u8)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<u8>) -> NonZero<u8>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1u8)?;
let two = NonZero::new(2u8)?;
let four = NonZero::new(4u8)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8u8)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10u8)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<u8>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10u8)?;
let three = NonZero::new(3u8)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<i8>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<u8>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1i8).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u8)?;
let four = NonZero::new(4u8)?;
let max = NonZero::new(u8::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<u8>) -> NonZero<u8>

Multiplies two non-zero integers together. Return NonZero::<u8>::MAX on overflow.

ยงExamples
let two = NonZero::new(2u8)?;
let four = NonZero::new(4u8)?;
let max = NonZero::new(u8::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<u8>) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > u8::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2u8)?;
let four = NonZero::new(4u8)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3u8)?;
let twenty_seven = NonZero::new(27u8)?;
let half_max = NonZero::new(u8::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<u8>

Raise non-zero value to an integer power. Return NonZero::<u8>::MAX on overflow.

ยงExamples
let three = NonZero::new(3u8)?;
let twenty_seven = NonZero::new(27u8)?;
let max = NonZero::new(u8::MAX)?;

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

impl NonZero<u8>

Source

pub const fn div_ceil(self, rhs: NonZero<u8>) -> NonZero<u8>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1u8).unwrap();
let max = NonZero::new(u8::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2u8).unwrap();
let three = NonZero::new(3u8).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<u16>

1.67.0 ยท Source

pub const BITS: u32 = 16u32

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

This value is equal to u16::BITS.

ยงExamples
assert_eq!(NonZero::<u16>::BITS, u16::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<u16>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<u16>::MIN.get(), 1u16);
1.70.0 ยท Source

pub const MAX: NonZero<u16>

The largest value that can be represented by this non-zero integer type, equal to u16::MAX.

ยงExamples
assert_eq!(NonZero::<u16>::MAX.get(), u16::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u16>::new(u16::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u16>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u16>::new(0b_01100100)?;
let b = NonZero::<u16>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u16>::new(0b_01100100)?;
let b = NonZero::<u16>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<u16>::new(0b100_0000)?;
let b = NonZero::<u16>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xa003u16)?;
let m = NonZero::new(0x3a)?;

assert_eq!(n.rotate_left(4), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x3au16)?;
let m = NonZero::new(0xa003)?;

assert_eq!(n.rotate_right(4), m);
Source

pub const fn swap_bytes(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234u16)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x3412)?);
Source

pub const fn reverse_bits(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234u16)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x2c48)?);
Source

pub const fn from_be(x: NonZero<u16>) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU16;
let n = NonZero::new(0x1Au16)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroU16::from_be(n), n)
} else {
    assert_eq!(NonZeroU16::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<u16>) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU16;
let n = NonZero::new(0x1Au16)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroU16::from_le(n), n)
} else {
    assert_eq!(NonZeroU16::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au16)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au16)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: u16) -> Option<NonZero<u16>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1u16)?;
let two = NonZero::new(2u16)?;
let max = NonZero::new(u16::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: u16) -> NonZero<u16>

Adds an unsigned integer to a non-zero value. Return NonZero::<u16>::MAX on overflow.

ยงExamples
let one = NonZero::new(1u16)?;
let two = NonZero::new(2u16)?;
let max = NonZero::new(u16::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: u16) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > u16::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1u16)?;
let two = NonZero::new(2u16)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<u16>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u16)?;
let three = NonZero::new(3u16)?;
let four = NonZero::new(4u16)?;
let max = NonZero::new(u16::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as u16::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7u16)?.ilog2(), 2);
assert_eq!(NonZero::new(8u16)?.ilog2(), 3);
assert_eq!(NonZero::new(9u16)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as u16::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99u16)?.ilog10(), 1);
assert_eq!(NonZero::new(100u16)?.ilog10(), 2);
assert_eq!(NonZero::new(101u16)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<u16>) -> NonZero<u16>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1u16)?;
let two = NonZero::new(2u16)?;
let four = NonZero::new(4u16)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8u16)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10u16)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<u16>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10u16)?;
let three = NonZero::new(3u16)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<i16>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<u16>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1i16).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u16)?;
let four = NonZero::new(4u16)?;
let max = NonZero::new(u16::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<u16>) -> NonZero<u16>

Multiplies two non-zero integers together. Return NonZero::<u16>::MAX on overflow.

ยงExamples
let two = NonZero::new(2u16)?;
let four = NonZero::new(4u16)?;
let max = NonZero::new(u16::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<u16>) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > u16::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2u16)?;
let four = NonZero::new(4u16)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3u16)?;
let twenty_seven = NonZero::new(27u16)?;
let half_max = NonZero::new(u16::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<u16>

Raise non-zero value to an integer power. Return NonZero::<u16>::MAX on overflow.

ยงExamples
let three = NonZero::new(3u16)?;
let twenty_seven = NonZero::new(27u16)?;
let max = NonZero::new(u16::MAX)?;

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

impl NonZero<u16>

Source

pub const fn div_ceil(self, rhs: NonZero<u16>) -> NonZero<u16>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1u16).unwrap();
let max = NonZero::new(u16::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2u16).unwrap();
let three = NonZero::new(3u16).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<u32>

1.67.0 ยท Source

pub const BITS: u32 = 32u32

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

This value is equal to u32::BITS.

ยงExamples
assert_eq!(NonZero::<u32>::BITS, u32::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<u32>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<u32>::MIN.get(), 1u32);
1.70.0 ยท Source

pub const MAX: NonZero<u32>

The largest value that can be represented by this non-zero integer type, equal to u32::MAX.

ยงExamples
assert_eq!(NonZero::<u32>::MAX.get(), u32::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u32>::new(u32::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u32>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u32>::new(0b_01100100)?;
let b = NonZero::<u32>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u32>::new(0b_01100100)?;
let b = NonZero::<u32>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<u32>::new(0b100_0000)?;
let b = NonZero::<u32>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x10000b3u32)?;
let m = NonZero::new(0xb301)?;

assert_eq!(n.rotate_left(8), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xb301u32)?;
let m = NonZero::new(0x10000b3)?;

assert_eq!(n.rotate_right(8), m);
Source

pub const fn swap_bytes(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678u32)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x78563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678u32)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x1e6a2c48)?);
Source

pub const fn from_be(x: NonZero<u32>) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU32;
let n = NonZero::new(0x1Au32)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroU32::from_be(n), n)
} else {
    assert_eq!(NonZeroU32::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<u32>) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU32;
let n = NonZero::new(0x1Au32)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroU32::from_le(n), n)
} else {
    assert_eq!(NonZeroU32::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au32)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au32)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: u32) -> Option<NonZero<u32>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1u32)?;
let two = NonZero::new(2u32)?;
let max = NonZero::new(u32::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: u32) -> NonZero<u32>

Adds an unsigned integer to a non-zero value. Return NonZero::<u32>::MAX on overflow.

ยงExamples
let one = NonZero::new(1u32)?;
let two = NonZero::new(2u32)?;
let max = NonZero::new(u32::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: u32) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > u32::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1u32)?;
let two = NonZero::new(2u32)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<u32>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u32)?;
let three = NonZero::new(3u32)?;
let four = NonZero::new(4u32)?;
let max = NonZero::new(u32::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as u32::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7u32)?.ilog2(), 2);
assert_eq!(NonZero::new(8u32)?.ilog2(), 3);
assert_eq!(NonZero::new(9u32)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as u32::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99u32)?.ilog10(), 1);
assert_eq!(NonZero::new(100u32)?.ilog10(), 2);
assert_eq!(NonZero::new(101u32)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<u32>) -> NonZero<u32>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1u32)?;
let two = NonZero::new(2u32)?;
let four = NonZero::new(4u32)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8u32)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10u32)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<u32>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10u32)?;
let three = NonZero::new(3u32)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<i32>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<u32>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1i32).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u32)?;
let four = NonZero::new(4u32)?;
let max = NonZero::new(u32::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<u32>) -> NonZero<u32>

Multiplies two non-zero integers together. Return NonZero::<u32>::MAX on overflow.

ยงExamples
let two = NonZero::new(2u32)?;
let four = NonZero::new(4u32)?;
let max = NonZero::new(u32::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<u32>) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > u32::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2u32)?;
let four = NonZero::new(4u32)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3u32)?;
let twenty_seven = NonZero::new(27u32)?;
let half_max = NonZero::new(u32::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

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

Raise non-zero value to an integer power. Return NonZero::<u32>::MAX on overflow.

ยงExamples
let three = NonZero::new(3u32)?;
let twenty_seven = NonZero::new(27u32)?;
let max = NonZero::new(u32::MAX)?;

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

impl NonZero<u32>

Source

pub const fn div_ceil(self, rhs: NonZero<u32>) -> NonZero<u32>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1u32).unwrap();
let max = NonZero::new(u32::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2u32).unwrap();
let three = NonZero::new(3u32).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<u64>

1.67.0 ยท Source

pub const BITS: u32 = 64u32

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

This value is equal to u64::BITS.

ยงExamples
assert_eq!(NonZero::<u64>::BITS, u64::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<u64>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<u64>::MIN.get(), 1u64);
1.70.0 ยท Source

pub const MAX: NonZero<u64>

The largest value that can be represented by this non-zero integer type, equal to u64::MAX.

ยงExamples
assert_eq!(NonZero::<u64>::MAX.get(), u64::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u64>::new(u64::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u64>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u64>::new(0b_01100100)?;
let b = NonZero::<u64>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u64>::new(0b_01100100)?;
let b = NonZero::<u64>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<u64>::new(0b100_0000)?;
let b = NonZero::<u64>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xaa00000000006e1u64)?;
let m = NonZero::new(0x6e10aa)?;

assert_eq!(n.rotate_left(12), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x6e10aau64)?;
let m = NonZero::new(0xaa00000000006e1)?;

assert_eq!(n.rotate_right(12), m);
Source

pub const fn swap_bytes(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456u64)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x5634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456u64)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<u64>) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU64;
let n = NonZero::new(0x1Au64)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroU64::from_be(n), n)
} else {
    assert_eq!(NonZeroU64::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<u64>) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU64;
let n = NonZero::new(0x1Au64)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroU64::from_le(n), n)
} else {
    assert_eq!(NonZeroU64::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au64)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au64)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: u64) -> Option<NonZero<u64>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1u64)?;
let two = NonZero::new(2u64)?;
let max = NonZero::new(u64::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: u64) -> NonZero<u64>

Adds an unsigned integer to a non-zero value. Return NonZero::<u64>::MAX on overflow.

ยงExamples
let one = NonZero::new(1u64)?;
let two = NonZero::new(2u64)?;
let max = NonZero::new(u64::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: u64) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > u64::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1u64)?;
let two = NonZero::new(2u64)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<u64>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u64)?;
let three = NonZero::new(3u64)?;
let four = NonZero::new(4u64)?;
let max = NonZero::new(u64::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as u64::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7u64)?.ilog2(), 2);
assert_eq!(NonZero::new(8u64)?.ilog2(), 3);
assert_eq!(NonZero::new(9u64)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as u64::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99u64)?.ilog10(), 1);
assert_eq!(NonZero::new(100u64)?.ilog10(), 2);
assert_eq!(NonZero::new(101u64)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<u64>) -> NonZero<u64>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1u64)?;
let two = NonZero::new(2u64)?;
let four = NonZero::new(4u64)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8u64)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10u64)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<u64>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10u64)?;
let three = NonZero::new(3u64)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<i64>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<u64>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1i64).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u64)?;
let four = NonZero::new(4u64)?;
let max = NonZero::new(u64::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<u64>) -> NonZero<u64>

Multiplies two non-zero integers together. Return NonZero::<u64>::MAX on overflow.

ยงExamples
let two = NonZero::new(2u64)?;
let four = NonZero::new(4u64)?;
let max = NonZero::new(u64::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<u64>) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > u64::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2u64)?;
let four = NonZero::new(4u64)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3u64)?;
let twenty_seven = NonZero::new(27u64)?;
let half_max = NonZero::new(u64::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<u64>

Raise non-zero value to an integer power. Return NonZero::<u64>::MAX on overflow.

ยงExamples
let three = NonZero::new(3u64)?;
let twenty_seven = NonZero::new(27u64)?;
let max = NonZero::new(u64::MAX)?;

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

impl NonZero<u64>

Source

pub const fn div_ceil(self, rhs: NonZero<u64>) -> NonZero<u64>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1u64).unwrap();
let max = NonZero::new(u64::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2u64).unwrap();
let three = NonZero::new(3u64).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<u128>

1.67.0 ยท Source

pub const BITS: u32 = 128u32

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

This value is equal to u128::BITS.

ยงExamples
assert_eq!(NonZero::<u128>::BITS, u128::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<u128>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<u128>::MIN.get(), 1u128);
1.70.0 ยท Source

pub const MAX: NonZero<u128>

The largest value that can be represented by this non-zero integer type, equal to u128::MAX.

ยงExamples
assert_eq!(NonZero::<u128>::MAX.get(), u128::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u128>::new(u128::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<u128>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u128>::new(0b_01100100)?;
let b = NonZero::<u128>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<u128>::new(0b_01100100)?;
let b = NonZero::<u128>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<u128>::new(0b100_0000)?;
let b = NonZero::<u128>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x13f40000000000000000000000004f76u128)?;
let m = NonZero::new(0x4f7613f4)?;

assert_eq!(n.rotate_left(16), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x4f7613f4u128)?;
let m = NonZero::new(0x13f40000000000000000000000004f76)?;

assert_eq!(n.rotate_right(16), m);
Source

pub const fn swap_bytes(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678901234567890123456789012u128)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x12907856341290785634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678901234567890123456789012u128)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x48091e6a2c48091e6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<u128>) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU128;
let n = NonZero::new(0x1Au128)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroU128::from_be(n), n)
} else {
    assert_eq!(NonZeroU128::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<u128>) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroU128;
let n = NonZero::new(0x1Au128)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroU128::from_le(n), n)
} else {
    assert_eq!(NonZeroU128::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au128)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Au128)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: u128) -> Option<NonZero<u128>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1u128)?;
let two = NonZero::new(2u128)?;
let max = NonZero::new(u128::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: u128) -> NonZero<u128>

Adds an unsigned integer to a non-zero value. Return NonZero::<u128>::MAX on overflow.

ยงExamples
let one = NonZero::new(1u128)?;
let two = NonZero::new(2u128)?;
let max = NonZero::new(u128::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: u128) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > u128::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1u128)?;
let two = NonZero::new(2u128)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<u128>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u128)?;
let three = NonZero::new(3u128)?;
let four = NonZero::new(4u128)?;
let max = NonZero::new(u128::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as u128::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7u128)?.ilog2(), 2);
assert_eq!(NonZero::new(8u128)?.ilog2(), 3);
assert_eq!(NonZero::new(9u128)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as u128::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99u128)?.ilog10(), 1);
assert_eq!(NonZero::new(100u128)?.ilog10(), 2);
assert_eq!(NonZero::new(101u128)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<u128>) -> NonZero<u128>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1u128)?;
let two = NonZero::new(2u128)?;
let four = NonZero::new(4u128)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8u128)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10u128)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<u128>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10u128)?;
let three = NonZero::new(3u128)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<i128>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<u128>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1i128).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2u128)?;
let four = NonZero::new(4u128)?;
let max = NonZero::new(u128::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<u128>) -> NonZero<u128>

Multiplies two non-zero integers together. Return NonZero::<u128>::MAX on overflow.

ยงExamples
let two = NonZero::new(2u128)?;
let four = NonZero::new(4u128)?;
let max = NonZero::new(u128::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<u128>) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > u128::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2u128)?;
let four = NonZero::new(4u128)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3u128)?;
let twenty_seven = NonZero::new(27u128)?;
let half_max = NonZero::new(u128::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<u128>

Raise non-zero value to an integer power. Return NonZero::<u128>::MAX on overflow.

ยงExamples
let three = NonZero::new(3u128)?;
let twenty_seven = NonZero::new(27u128)?;
let max = NonZero::new(u128::MAX)?;

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

impl NonZero<u128>

Source

pub const fn div_ceil(self, rhs: NonZero<u128>) -> NonZero<u128>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1u128).unwrap();
let max = NonZero::new(u128::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2u128).unwrap();
let three = NonZero::new(3u128).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<usize>

1.67.0 ยท Source

pub const BITS: u32 = 64u32

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

This value is equal to usize::BITS.

ยงExamples
assert_eq!(NonZero::<usize>::BITS, usize::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<usize>

The smallest value that can be represented by this non-zero integer type, 1.

ยงExamples
assert_eq!(NonZero::<usize>::MIN.get(), 1usize);
1.70.0 ยท Source

pub const MAX: NonZero<usize>

The largest value that can be represented by this non-zero integer type, equal to usize::MAX.

ยงExamples
assert_eq!(NonZero::<usize>::MAX.get(), usize::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<usize>::new(usize::MAX)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<usize>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<usize>::new(0b_01100100)?;
let b = NonZero::<usize>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<usize>::new(0b_01100100)?;
let b = NonZero::<usize>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<usize>::new(0b100_0000)?;
let b = NonZero::<usize>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xaa00000000006e1usize)?;
let m = NonZero::new(0x6e10aa)?;

assert_eq!(n.rotate_left(12), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x6e10aausize)?;
let m = NonZero::new(0xaa00000000006e1)?;

assert_eq!(n.rotate_right(12), m);
Source

pub const fn swap_bytes(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456usize)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x5634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456usize)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<usize>) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroUsize;
let n = NonZero::new(0x1Ausize)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroUsize::from_be(n), n)
} else {
    assert_eq!(NonZeroUsize::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<usize>) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroUsize;
let n = NonZero::new(0x1Ausize)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroUsize::from_le(n), n)
} else {
    assert_eq!(NonZeroUsize::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ausize)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ausize)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_add(self, other: usize) -> Option<NonZero<usize>>

Adds an unsigned integer to a non-zero value. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let one = NonZero::new(1usize)?;
let two = NonZero::new(2usize)?;
let max = NonZero::new(usize::MAX)?;

assert_eq!(Some(two), one.checked_add(1));
assert_eq!(None, max.checked_add(1));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_add(self, other: usize) -> NonZero<usize>

Adds an unsigned integer to a non-zero value. Return NonZero::<usize>::MAX on overflow.

ยงExamples
let one = NonZero::new(1usize)?;
let two = NonZero::new(2usize)?;
let max = NonZero::new(usize::MAX)?;

assert_eq!(two, one.saturating_add(1));
assert_eq!(max, max.saturating_add(1));
Source

pub const unsafe fn unchecked_add(self, other: usize) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self + rhs > usize::MAX.

ยงExamples
#![feature(nonzero_ops)]

let one = NonZero::new(1usize)?;
let two = NonZero::new(2usize)?;

assert_eq!(two, unsafe { one.unchecked_add(1) });
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_next_power_of_two(self) -> Option<NonZero<usize>>

Returns the smallest power of two greater than or equal to self. Checks for overflow and returns None if the next power of two is greater than the typeโ€™s maximum value. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2usize)?;
let three = NonZero::new(3usize)?;
let four = NonZero::new(4usize)?;
let max = NonZero::new(usize::MAX)?;

assert_eq!(Some(two), two.checked_next_power_of_two() );
assert_eq!(Some(four), three.checked_next_power_of_two() );
assert_eq!(None, max.checked_next_power_of_two() );
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

This is the same operation as usize::ilog2, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(7usize)?.ilog2(), 2);
assert_eq!(NonZero::new(8usize)?.ilog2(), 3);
assert_eq!(NonZero::new(9usize)?.ilog2(), 3);
1.67.0 (const: 1.67.0) ยท Source

pub const fn ilog10(self) -> u32

Returns the base 10 logarithm of the number, rounded down.

This is the same operation as usize::ilog10, except that it has no failure cases to worry about since this value can never be zero.

ยงExamples
assert_eq!(NonZero::new(99usize)?.ilog10(), 1);
assert_eq!(NonZero::new(100usize)?.ilog10(), 2);
assert_eq!(NonZero::new(101usize)?.ilog10(), 2);
1.85.0 (const: 1.85.0) ยท Source

pub const fn midpoint(self, rhs: NonZero<usize>) -> NonZero<usize>

Calculates the midpoint (average) between self and rhs.

midpoint(a, b) is (a + b) >> 1 as if it were performed in a sufficiently-large signed integral type. This implies that the result is always rounded towards negative infinity and that no overflow will ever occur.

ยงExamples
let one = NonZero::new(1usize)?;
let two = NonZero::new(2usize)?;
let four = NonZero::new(4usize)?;

assert_eq!(one.midpoint(four), two);
assert_eq!(four.midpoint(one), two);
1.59.0 (const: 1.59.0) ยท Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == (1 << k) for some k.

On many architectures, this function can perform better than is_power_of_two() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let eight = NonZero::new(8usize)?;
assert!(eight.is_power_of_two());
let ten = NonZero::new(10usize)?;
assert!(!ten.is_power_of_two());
1.84.0 (const: 1.84.0) ยท Source

pub const fn isqrt(self) -> NonZero<usize>

Returns the square root of the number, rounded down.

ยงExamples
let ten = NonZero::new(10usize)?;
let three = NonZero::new(3usize)?;

assert_eq!(ten.isqrt(), three);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_signed(self) -> NonZero<isize>

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

ยงExamples

let n = NonZero::<usize>::MAX;

assert_eq!(n.cast_signed(), NonZero::new(-1isize).unwrap());
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2usize)?;
let four = NonZero::new(4usize)?;
let max = NonZero::new(usize::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<usize>) -> NonZero<usize>

Multiplies two non-zero integers together. Return NonZero::<usize>::MAX on overflow.

ยงExamples
let two = NonZero::new(2usize)?;
let four = NonZero::new(4usize)?;
let max = NonZero::new(usize::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<usize>) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > usize::MAX.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2usize)?;
let four = NonZero::new(4usize)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3usize)?;
let twenty_seven = NonZero::new(27usize)?;
let half_max = NonZero::new(usize::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<usize>

Raise non-zero value to an integer power. Return NonZero::<usize>::MAX on overflow.

ยงExamples
let three = NonZero::new(3usize)?;
let twenty_seven = NonZero::new(27usize)?;
let max = NonZero::new(usize::MAX)?;

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

impl NonZero<usize>

Source

pub const fn div_ceil(self, rhs: NonZero<usize>) -> NonZero<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (unsigned_nonzero_div_ceil)

Calculates the quotient of self and rhs, rounding the result towards positive infinity.

The result is guaranteed to be non-zero.

ยงExamples
let one = NonZero::new(1usize).unwrap();
let max = NonZero::new(usize::MAX).unwrap();
assert_eq!(one.div_ceil(max), one);

let two = NonZero::new(2usize).unwrap();
let three = NonZero::new(3usize).unwrap();
assert_eq!(three.div_ceil(two), two);
Sourceยง

impl NonZero<i8>

1.67.0 ยท Source

pub const BITS: u32 = 8u32

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

This value is equal to i8::BITS.

ยงExamples
assert_eq!(NonZero::<i8>::BITS, i8::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<i8>

The smallest value that can be represented by this non-zero integer type, equal to i8::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i8>::MIN.get(), i8::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<i8>

The largest value that can be represented by this non-zero integer type, equal to i8::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i8>::MAX.get(), i8::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i8>::new(-1i8)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i8>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i8>::new(0b_01100100)?;
let b = NonZero::<i8>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i8>::new(0b_01100100)?;
let b = NonZero::<i8>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<i8>::new(0b100_0000)?;
let b = NonZero::<i8>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(-0x7ei8)?;
let m = NonZero::new(0xa)?;

assert_eq!(n.rotate_left(2), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xai8)?;
let m = NonZero::new(-0x7e)?;

assert_eq!(n.rotate_right(2), m);
Source

pub const fn swap_bytes(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12i8)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x12)?);
Source

pub const fn reverse_bits(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12i8)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x48)?);
Source

pub const fn from_be(x: NonZero<i8>) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI8;
let n = NonZero::new(0x1Ai8)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroI8::from_be(n), n)
} else {
    assert_eq!(NonZeroI8::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<i8>) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI8;
let n = NonZero::new(0x1Ai8)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroI8::from_le(n), n)
} else {
    assert_eq!(NonZeroI8::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai8)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai8)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<i8>

Computes the absolute value of self. See i8::abs for documentation on overflow behavior.

ยงExample
let pos = NonZero::new(1i8)?;
let neg = NonZero::new(-1i8)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<i8>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<i8>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1i8)?;
let neg = NonZero::new(-1i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<i8>, bool)

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

ยงExample
let pos = NonZero::new(1i8)?;
let neg = NonZero::new(-1i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<i8>

Saturating absolute value, see i8::saturating_abs.

ยงExample
let pos = NonZero::new(1i8)?;
let neg = NonZero::new(-1i8)?;
let min = NonZero::new(i8::MIN)?;
let min_plus = NonZero::new(i8::MIN + 1)?;
let max = NonZero::new(i8::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<i8>

Wrapping absolute value, see i8::wrapping_abs.

ยงExample
let pos = NonZero::new(1i8)?;
let neg = NonZero::new(-1i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<u8>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1u8)?;
let i_pos = NonZero::new(1i8)?;
let i_neg = NonZero::new(-1i8)?;
let i_min = NonZero::new(i8::MIN)?;
let u_max = NonZero::new(u8::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<i8>>

Checked negation. Computes -self, returning None if self == NonZero::<i8>::MIN.

ยงExample
let pos_five = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<i8>, bool)

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

See i8::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<i8>

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

ยงExample
let pos_five = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;
let min = NonZero::new(i8::MIN)?;
let min_plus_one = NonZero::new(i8::MIN + 1)?;
let max = NonZero::new(i8::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<i8>

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

See i8::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i8)?;
let neg_five = NonZero::new(-5i8)?;
let min = NonZero::new(i8::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<u8>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1i8).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<u8>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2i8)?;
let four = NonZero::new(4i8)?;
let max = NonZero::new(i8::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<i8>) -> NonZero<i8>

Multiplies two non-zero integers together. Return NonZero::<i8>::MAX on overflow.

ยงExamples
let two = NonZero::new(2i8)?;
let four = NonZero::new(4i8)?;
let max = NonZero::new(i8::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<i8>) -> NonZero<i8>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > i8::MAX, or self * rhs < i8::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2i8)?;
let four = NonZero::new(4i8)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3i8)?;
let twenty_seven = NonZero::new(27i8)?;
let half_max = NonZero::new(i8::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<i8>

Raise non-zero value to an integer power. Return NonZero::<i8>::MIN or NonZero::<i8>::MAX on overflow.

ยงExamples
let three = NonZero::new(3i8)?;
let twenty_seven = NonZero::new(27i8)?;
let max = NonZero::new(i8::MAX)?;

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

impl NonZero<i16>

1.67.0 ยท Source

pub const BITS: u32 = 16u32

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

This value is equal to i16::BITS.

ยงExamples
assert_eq!(NonZero::<i16>::BITS, i16::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<i16>

The smallest value that can be represented by this non-zero integer type, equal to i16::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i16>::MIN.get(), i16::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<i16>

The largest value that can be represented by this non-zero integer type, equal to i16::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i16>::MAX.get(), i16::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i16>::new(-1i16)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i16>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i16>::new(0b_01100100)?;
let b = NonZero::<i16>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i16>::new(0b_01100100)?;
let b = NonZero::<i16>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<i16>::new(0b100_0000)?;
let b = NonZero::<i16>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(-0x5ffdi16)?;
let m = NonZero::new(0x3a)?;

assert_eq!(n.rotate_left(4), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x3ai16)?;
let m = NonZero::new(-0x5ffd)?;

assert_eq!(n.rotate_right(4), m);
Source

pub const fn swap_bytes(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234i16)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x3412)?);
Source

pub const fn reverse_bits(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234i16)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x2c48)?);
Source

pub const fn from_be(x: NonZero<i16>) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI16;
let n = NonZero::new(0x1Ai16)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroI16::from_be(n), n)
} else {
    assert_eq!(NonZeroI16::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<i16>) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI16;
let n = NonZero::new(0x1Ai16)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroI16::from_le(n), n)
} else {
    assert_eq!(NonZeroI16::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai16)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai16)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<i16>

Computes the absolute value of self. See i16::abs for documentation on overflow behavior.

ยงExample
let pos = NonZero::new(1i16)?;
let neg = NonZero::new(-1i16)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<i16>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<i16>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1i16)?;
let neg = NonZero::new(-1i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<i16>, bool)

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

ยงExample
let pos = NonZero::new(1i16)?;
let neg = NonZero::new(-1i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<i16>

Saturating absolute value, see i16::saturating_abs.

ยงExample
let pos = NonZero::new(1i16)?;
let neg = NonZero::new(-1i16)?;
let min = NonZero::new(i16::MIN)?;
let min_plus = NonZero::new(i16::MIN + 1)?;
let max = NonZero::new(i16::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<i16>

Wrapping absolute value, see i16::wrapping_abs.

ยงExample
let pos = NonZero::new(1i16)?;
let neg = NonZero::new(-1i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<u16>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1u16)?;
let i_pos = NonZero::new(1i16)?;
let i_neg = NonZero::new(-1i16)?;
let i_min = NonZero::new(i16::MIN)?;
let u_max = NonZero::new(u16::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<i16>>

Checked negation. Computes -self, returning None if self == NonZero::<i16>::MIN.

ยงExample
let pos_five = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<i16>, bool)

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

See i16::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<i16>

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

ยงExample
let pos_five = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;
let min = NonZero::new(i16::MIN)?;
let min_plus_one = NonZero::new(i16::MIN + 1)?;
let max = NonZero::new(i16::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<i16>

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

See i16::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i16)?;
let neg_five = NonZero::new(-5i16)?;
let min = NonZero::new(i16::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<u16>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1i16).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<u16>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2i16)?;
let four = NonZero::new(4i16)?;
let max = NonZero::new(i16::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<i16>) -> NonZero<i16>

Multiplies two non-zero integers together. Return NonZero::<i16>::MAX on overflow.

ยงExamples
let two = NonZero::new(2i16)?;
let four = NonZero::new(4i16)?;
let max = NonZero::new(i16::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<i16>) -> NonZero<i16>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > i16::MAX, or self * rhs < i16::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2i16)?;
let four = NonZero::new(4i16)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3i16)?;
let twenty_seven = NonZero::new(27i16)?;
let half_max = NonZero::new(i16::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<i16>

Raise non-zero value to an integer power. Return NonZero::<i16>::MIN or NonZero::<i16>::MAX on overflow.

ยงExamples
let three = NonZero::new(3i16)?;
let twenty_seven = NonZero::new(27i16)?;
let max = NonZero::new(i16::MAX)?;

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

impl NonZero<i32>

1.67.0 ยท Source

pub const BITS: u32 = 32u32

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

This value is equal to i32::BITS.

ยงExamples
assert_eq!(NonZero::<i32>::BITS, i32::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<i32>

The smallest value that can be represented by this non-zero integer type, equal to i32::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i32>::MIN.get(), i32::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<i32>

The largest value that can be represented by this non-zero integer type, equal to i32::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i32>::MAX.get(), i32::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i32>::new(-1i32)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i32>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i32>::new(0b_01100100)?;
let b = NonZero::<i32>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i32>::new(0b_01100100)?;
let b = NonZero::<i32>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<i32>::new(0b100_0000)?;
let b = NonZero::<i32>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x10000b3i32)?;
let m = NonZero::new(0xb301)?;

assert_eq!(n.rotate_left(8), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xb301i32)?;
let m = NonZero::new(0x10000b3)?;

assert_eq!(n.rotate_right(8), m);
Source

pub const fn swap_bytes(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678i32)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x78563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678i32)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x1e6a2c48)?);
Source

pub const fn from_be(x: NonZero<i32>) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI32;
let n = NonZero::new(0x1Ai32)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroI32::from_be(n), n)
} else {
    assert_eq!(NonZeroI32::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<i32>) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI32;
let n = NonZero::new(0x1Ai32)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroI32::from_le(n), n)
} else {
    assert_eq!(NonZeroI32::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai32)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai32)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<i32>

Computes the absolute value of self. See i32::abs for documentation on overflow behavior.

ยงExample
let pos = NonZero::new(1i32)?;
let neg = NonZero::new(-1i32)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<i32>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<i32>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1i32)?;
let neg = NonZero::new(-1i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<i32>, bool)

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

ยงExample
let pos = NonZero::new(1i32)?;
let neg = NonZero::new(-1i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<i32>

Saturating absolute value, see i32::saturating_abs.

ยงExample
let pos = NonZero::new(1i32)?;
let neg = NonZero::new(-1i32)?;
let min = NonZero::new(i32::MIN)?;
let min_plus = NonZero::new(i32::MIN + 1)?;
let max = NonZero::new(i32::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<i32>

Wrapping absolute value, see i32::wrapping_abs.

ยงExample
let pos = NonZero::new(1i32)?;
let neg = NonZero::new(-1i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<u32>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1u32)?;
let i_pos = NonZero::new(1i32)?;
let i_neg = NonZero::new(-1i32)?;
let i_min = NonZero::new(i32::MIN)?;
let u_max = NonZero::new(u32::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<i32>>

Checked negation. Computes -self, returning None if self == NonZero::<i32>::MIN.

ยงExample
let pos_five = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<i32>, bool)

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

See i32::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<i32>

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

ยงExample
let pos_five = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;
let min = NonZero::new(i32::MIN)?;
let min_plus_one = NonZero::new(i32::MIN + 1)?;
let max = NonZero::new(i32::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<i32>

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

See i32::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i32)?;
let neg_five = NonZero::new(-5i32)?;
let min = NonZero::new(i32::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<u32>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1i32).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<u32>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2i32)?;
let four = NonZero::new(4i32)?;
let max = NonZero::new(i32::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<i32>) -> NonZero<i32>

Multiplies two non-zero integers together. Return NonZero::<i32>::MAX on overflow.

ยงExamples
let two = NonZero::new(2i32)?;
let four = NonZero::new(4i32)?;
let max = NonZero::new(i32::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<i32>) -> NonZero<i32>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > i32::MAX, or self * rhs < i32::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2i32)?;
let four = NonZero::new(4i32)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3i32)?;
let twenty_seven = NonZero::new(27i32)?;
let half_max = NonZero::new(i32::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<i32>

Raise non-zero value to an integer power. Return NonZero::<i32>::MIN or NonZero::<i32>::MAX on overflow.

ยงExamples
let three = NonZero::new(3i32)?;
let twenty_seven = NonZero::new(27i32)?;
let max = NonZero::new(i32::MAX)?;

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

impl NonZero<i64>

1.67.0 ยท Source

pub const BITS: u32 = 64u32

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

This value is equal to i64::BITS.

ยงExamples
assert_eq!(NonZero::<i64>::BITS, i64::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<i64>

The smallest value that can be represented by this non-zero integer type, equal to i64::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i64>::MIN.get(), i64::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<i64>

The largest value that can be represented by this non-zero integer type, equal to i64::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i64>::MAX.get(), i64::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i64>::new(-1i64)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i64>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i64>::new(0b_01100100)?;
let b = NonZero::<i64>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i64>::new(0b_01100100)?;
let b = NonZero::<i64>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<i64>::new(0b100_0000)?;
let b = NonZero::<i64>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xaa00000000006e1i64)?;
let m = NonZero::new(0x6e10aa)?;

assert_eq!(n.rotate_left(12), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x6e10aai64)?;
let m = NonZero::new(0xaa00000000006e1)?;

assert_eq!(n.rotate_right(12), m);
Source

pub const fn swap_bytes(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456i64)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x5634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456i64)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<i64>) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI64;
let n = NonZero::new(0x1Ai64)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroI64::from_be(n), n)
} else {
    assert_eq!(NonZeroI64::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<i64>) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI64;
let n = NonZero::new(0x1Ai64)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroI64::from_le(n), n)
} else {
    assert_eq!(NonZeroI64::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai64)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai64)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<i64>

Computes the absolute value of self. See i64::abs for documentation on overflow behavior.

ยงExample
let pos = NonZero::new(1i64)?;
let neg = NonZero::new(-1i64)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<i64>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<i64>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1i64)?;
let neg = NonZero::new(-1i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<i64>, bool)

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

ยงExample
let pos = NonZero::new(1i64)?;
let neg = NonZero::new(-1i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<i64>

Saturating absolute value, see i64::saturating_abs.

ยงExample
let pos = NonZero::new(1i64)?;
let neg = NonZero::new(-1i64)?;
let min = NonZero::new(i64::MIN)?;
let min_plus = NonZero::new(i64::MIN + 1)?;
let max = NonZero::new(i64::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<i64>

Wrapping absolute value, see i64::wrapping_abs.

ยงExample
let pos = NonZero::new(1i64)?;
let neg = NonZero::new(-1i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<u64>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1u64)?;
let i_pos = NonZero::new(1i64)?;
let i_neg = NonZero::new(-1i64)?;
let i_min = NonZero::new(i64::MIN)?;
let u_max = NonZero::new(u64::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<i64>>

Checked negation. Computes -self, returning None if self == NonZero::<i64>::MIN.

ยงExample
let pos_five = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<i64>, bool)

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

See i64::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<i64>

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

ยงExample
let pos_five = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;
let min = NonZero::new(i64::MIN)?;
let min_plus_one = NonZero::new(i64::MIN + 1)?;
let max = NonZero::new(i64::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<i64>

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

See i64::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i64)?;
let neg_five = NonZero::new(-5i64)?;
let min = NonZero::new(i64::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<u64>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1i64).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<u64>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2i64)?;
let four = NonZero::new(4i64)?;
let max = NonZero::new(i64::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<i64>) -> NonZero<i64>

Multiplies two non-zero integers together. Return NonZero::<i64>::MAX on overflow.

ยงExamples
let two = NonZero::new(2i64)?;
let four = NonZero::new(4i64)?;
let max = NonZero::new(i64::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<i64>) -> NonZero<i64>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > i64::MAX, or self * rhs < i64::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2i64)?;
let four = NonZero::new(4i64)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3i64)?;
let twenty_seven = NonZero::new(27i64)?;
let half_max = NonZero::new(i64::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<i64>

Raise non-zero value to an integer power. Return NonZero::<i64>::MIN or NonZero::<i64>::MAX on overflow.

ยงExamples
let three = NonZero::new(3i64)?;
let twenty_seven = NonZero::new(27i64)?;
let max = NonZero::new(i64::MAX)?;

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

impl NonZero<i128>

1.67.0 ยท Source

pub const BITS: u32 = 128u32

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

This value is equal to i128::BITS.

ยงExamples
assert_eq!(NonZero::<i128>::BITS, i128::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<i128>

The smallest value that can be represented by this non-zero integer type, equal to i128::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i128>::MIN.get(), i128::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<i128>

The largest value that can be represented by this non-zero integer type, equal to i128::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<i128>::MAX.get(), i128::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i128>::new(-1i128)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<i128>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i128>::new(0b_01100100)?;
let b = NonZero::<i128>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<i128>::new(0b_01100100)?;
let b = NonZero::<i128>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<i128>::new(0b100_0000)?;
let b = NonZero::<i128>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x13f40000000000000000000000004f76i128)?;
let m = NonZero::new(0x4f7613f4)?;

assert_eq!(n.rotate_left(16), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x4f7613f4i128)?;
let m = NonZero::new(0x13f40000000000000000000000004f76)?;

assert_eq!(n.rotate_right(16), m);
Source

pub const fn swap_bytes(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678901234567890123456789012i128)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x12907856341290785634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x12345678901234567890123456789012i128)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x48091e6a2c48091e6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<i128>) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI128;
let n = NonZero::new(0x1Ai128)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroI128::from_be(n), n)
} else {
    assert_eq!(NonZeroI128::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<i128>) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroI128;
let n = NonZero::new(0x1Ai128)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroI128::from_le(n), n)
} else {
    assert_eq!(NonZeroI128::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai128)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Ai128)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<i128>

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

ยงExample
let pos = NonZero::new(1i128)?;
let neg = NonZero::new(-1i128)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<i128>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<i128>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1i128)?;
let neg = NonZero::new(-1i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<i128>, bool)

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

ยงExample
let pos = NonZero::new(1i128)?;
let neg = NonZero::new(-1i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<i128>

Saturating absolute value, see i128::saturating_abs.

ยงExample
let pos = NonZero::new(1i128)?;
let neg = NonZero::new(-1i128)?;
let min = NonZero::new(i128::MIN)?;
let min_plus = NonZero::new(i128::MIN + 1)?;
let max = NonZero::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<i128>

Wrapping absolute value, see i128::wrapping_abs.

ยงExample
let pos = NonZero::new(1i128)?;
let neg = NonZero::new(-1i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<u128>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1u128)?;
let i_pos = NonZero::new(1i128)?;
let i_neg = NonZero::new(-1i128)?;
let i_min = NonZero::new(i128::MIN)?;
let u_max = NonZero::new(u128::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<i128>>

Checked negation. Computes -self, returning None if self == NonZero::<i128>::MIN.

ยงExample
let pos_five = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<i128>, bool)

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

See i128::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<i128>

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

ยงExample
let pos_five = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;
let min = NonZero::new(i128::MIN)?;
let min_plus_one = NonZero::new(i128::MIN + 1)?;
let max = NonZero::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);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<i128>

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

See i128::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5i128)?;
let neg_five = NonZero::new(-5i128)?;
let min = NonZero::new(i128::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<u128>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1i128).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<u128>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2i128)?;
let four = NonZero::new(4i128)?;
let max = NonZero::new(i128::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<i128>) -> NonZero<i128>

Multiplies two non-zero integers together. Return NonZero::<i128>::MAX on overflow.

ยงExamples
let two = NonZero::new(2i128)?;
let four = NonZero::new(4i128)?;
let max = NonZero::new(i128::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<i128>) -> NonZero<i128>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > i128::MAX, or self * rhs < i128::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2i128)?;
let four = NonZero::new(4i128)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3i128)?;
let twenty_seven = NonZero::new(27i128)?;
let half_max = NonZero::new(i128::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<i128>

Raise non-zero value to an integer power. Return NonZero::<i128>::MIN or NonZero::<i128>::MAX on overflow.

ยงExamples
let three = NonZero::new(3i128)?;
let twenty_seven = NonZero::new(27i128)?;
let max = NonZero::new(i128::MAX)?;

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

impl NonZero<isize>

1.67.0 ยท Source

pub const BITS: u32 = 64u32

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

This value is equal to isize::BITS.

ยงExamples
assert_eq!(NonZero::<isize>::BITS, isize::BITS);
1.70.0 ยท Source

pub const MIN: NonZero<isize>

The smallest value that can be represented by this non-zero integer type, equal to isize::MIN.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<isize>::MIN.get(), isize::MIN);
1.70.0 ยท Source

pub const MAX: NonZero<isize>

The largest value that can be represented by this non-zero integer type, equal to isize::MAX.

Note: While most integer types are defined for every whole number between MIN and MAX, signed non-zero integers are a special case. They have a โ€œgapโ€ at 0.

ยงExamples
assert_eq!(NonZero::<isize>::MAX.get(), isize::MAX);
1.53.0 (const: 1.53.0) ยท Source

pub const fn leading_zeros(self) -> u32

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

On many architectures, this function can perform better than leading_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<isize>::new(-1isize)?;

assert_eq!(n.leading_zeros(), 0);
1.53.0 (const: 1.53.0) ยท Source

pub const fn trailing_zeros(self) -> u32

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

On many architectures, this function can perform better than trailing_zeros() on the underlying integer type, as special handling of zero can be avoided.

ยงExamples
let n = NonZero::<isize>::new(0b0101000)?;

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

pub const fn isolate_most_significant_one(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the most significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<isize>::new(0b_01100100)?;
let b = NonZero::<isize>::new(0b_01000000)?;

assert_eq!(a.isolate_most_significant_one(), b);
Source

pub const fn isolate_least_significant_one(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (isolate_most_least_significant_one)

Returns self with only the least significant bit set.

ยงExample
#![feature(isolate_most_least_significant_one)]

let a = NonZero::<isize>::new(0b_01100100)?;
let b = NonZero::<isize>::new(0b_00000100)?;

assert_eq!(a.isolate_least_significant_one(), b);
1.86.0 (const: 1.86.0) ยท Source

pub const fn count_ones(self) -> NonZero<u32>

Returns the number of ones in the binary representation of self.

ยงExamples
let a = NonZero::<isize>::new(0b100_0000)?;
let b = NonZero::<isize>::new(0b100_0011)?;

assert_eq!(a.count_ones(), NonZero::new(1)?);
assert_eq!(b.count_ones(), NonZero::new(3)?);
Source

pub const fn rotate_left(self, n: u32) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isnโ€™t the same operation as the << shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0xaa00000000006e1isize)?;
let m = NonZero::new(0x6e10aa)?;

assert_eq!(n.rotate_left(12), m);
Source

pub const fn rotate_right(self, n: u32) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Shifts the bits to the right by a specified amount, n, wrapping the truncated bits to the beginning of the resulting integer.

Please note this isnโ€™t the same operation as the >> shifting operator!

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x6e10aaisize)?;
let m = NonZero::new(0xaa00000000006e1)?;

assert_eq!(n.rotate_right(12), m);
Source

pub const fn swap_bytes(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the byte order of the integer.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456isize)?;
let m = n.swap_bytes();

assert_eq!(m, NonZero::new(0x5634129078563412)?);
Source

pub const fn reverse_bits(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1234567890123456isize)?;
let m = n.reverse_bits();

assert_eq!(m, NonZero::new(0x6a2c48091e6a2c48)?);
Source

pub const fn from_be(x: NonZero<isize>) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from big endian to the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroIsize;
let n = NonZero::new(0x1Aisize)?;

if cfg!(target_endian = "big") {
    assert_eq!(NonZeroIsize::from_be(n), n)
} else {
    assert_eq!(NonZeroIsize::from_be(n), n.swap_bytes())
}
Source

pub const fn from_le(x: NonZero<isize>) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts an integer from little endian to the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
use std::num::NonZeroIsize;
let n = NonZero::new(0x1Aisize)?;

if cfg!(target_endian = "little") {
    assert_eq!(NonZeroIsize::from_le(n), n)
} else {
    assert_eq!(NonZeroIsize::from_le(n), n.swap_bytes())
}
Source

pub const fn to_be(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to big endian from the targetโ€™s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Aisize)?;

if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
Source

pub const fn to_le(self) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_bitwise)

Converts self to little endian from the targetโ€™s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

ยงExamples
#![feature(nonzero_bitwise)]
let n = NonZero::new(0x1Aisize)?;

if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
1.64.0 (const: 1.64.0) ยท Source

pub const fn abs(self) -> NonZero<isize>

Computes the absolute value of self. See isize::abs for documentation on overflow behavior.

ยงExample
let pos = NonZero::new(1isize)?;
let neg = NonZero::new(-1isize)?;

assert_eq!(pos, pos.abs());
assert_eq!(pos, neg.abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn checked_abs(self) -> Option<NonZero<isize>>

Checked absolute value. Checks for overflow and returns None if self == NonZero::<isize>::MIN. The result cannot be zero.

ยงExample
let pos = NonZero::new(1isize)?;
let neg = NonZero::new(-1isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!(Some(pos), neg.checked_abs());
assert_eq!(None, min.checked_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn overflowing_abs(self) -> (NonZero<isize>, bool)

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

ยงExample
let pos = NonZero::new(1isize)?;
let neg = NonZero::new(-1isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!((pos, false), pos.overflowing_abs());
assert_eq!((pos, false), neg.overflowing_abs());
assert_eq!((min, true), min.overflowing_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_abs(self) -> NonZero<isize>

Saturating absolute value, see isize::saturating_abs.

ยงExample
let pos = NonZero::new(1isize)?;
let neg = NonZero::new(-1isize)?;
let min = NonZero::new(isize::MIN)?;
let min_plus = NonZero::new(isize::MIN + 1)?;
let max = NonZero::new(isize::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());
1.64.0 (const: 1.64.0) ยท Source

pub const fn wrapping_abs(self) -> NonZero<isize>

Wrapping absolute value, see isize::wrapping_abs.

ยงExample
let pos = NonZero::new(1isize)?;
let neg = NonZero::new(-1isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!(pos, pos.wrapping_abs());
assert_eq!(pos, neg.wrapping_abs());
assert_eq!(min, min.wrapping_abs());
assert_eq!(max, (-max).wrapping_abs());
1.64.0 (const: 1.64.0) ยท Source

pub const fn unsigned_abs(self) -> NonZero<usize>

Computes the absolute value of self without any wrapping or panicking.

ยงExample
let u_pos = NonZero::new(1usize)?;
let i_pos = NonZero::new(1isize)?;
let i_neg = NonZero::new(-1isize)?;
let i_min = NonZero::new(isize::MIN)?;
let u_max = NonZero::new(usize::MAX / 2 + 1)?;

assert_eq!(u_pos, i_pos.unsigned_abs());
assert_eq!(u_pos, i_neg.unsigned_abs());
assert_eq!(u_max, i_min.unsigned_abs());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;

assert!(pos_five.is_positive());
assert!(!neg_five.is_positive());
1.71.0 (const: 1.71.0) ยท 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 = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;

assert!(neg_five.is_negative());
assert!(!pos_five.is_negative());
1.71.0 (const: 1.71.0) ยท Source

pub const fn checked_neg(self) -> Option<NonZero<isize>>

Checked negation. Computes -self, returning None if self == NonZero::<isize>::MIN.

ยงExample
let pos_five = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!(pos_five.checked_neg(), Some(neg_five));
assert_eq!(min.checked_neg(), None);
1.71.0 (const: 1.71.0) ยท Source

pub const fn overflowing_neg(self) -> (NonZero<isize>, bool)

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

See isize::overflowing_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!(pos_five.overflowing_neg(), (neg_five, false));
assert_eq!(min.overflowing_neg(), (min, true));
1.71.0 (const: 1.71.0) ยท Source

pub const fn saturating_neg(self) -> NonZero<isize>

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

ยงExample
let pos_five = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;
let min = NonZero::new(isize::MIN)?;
let min_plus_one = NonZero::new(isize::MIN + 1)?;
let max = NonZero::new(isize::MAX)?;

assert_eq!(pos_five.saturating_neg(), neg_five);
assert_eq!(min.saturating_neg(), max);
assert_eq!(max.saturating_neg(), min_plus_one);
1.71.0 (const: 1.71.0) ยท Source

pub const fn wrapping_neg(self) -> NonZero<isize>

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

See isize::wrapping_neg for documentation on overflow behavior.

ยงExample
let pos_five = NonZero::new(5isize)?;
let neg_five = NonZero::new(-5isize)?;
let min = NonZero::new(isize::MIN)?;

assert_eq!(pos_five.wrapping_neg(), neg_five);
assert_eq!(min.wrapping_neg(), min);
1.87.0 (const: 1.87.0) ยท Source

pub const fn cast_unsigned(self) -> NonZero<usize>

Returns the bit pattern of self reinterpreted as an unsigned integer of the same size.

ยงExamples

let n = NonZero::new(-1isize).unwrap();

assert_eq!(n.cast_unsigned(), NonZero::<usize>::MAX);
1.64.0 (const: 1.64.0) ยท Source

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

Multiplies two non-zero integers together. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let two = NonZero::new(2isize)?;
let four = NonZero::new(4isize)?;
let max = NonZero::new(isize::MAX)?;

assert_eq!(Some(four), two.checked_mul(two));
assert_eq!(None, max.checked_mul(two));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_mul(self, other: NonZero<isize>) -> NonZero<isize>

Multiplies two non-zero integers together. Return NonZero::<isize>::MAX on overflow.

ยงExamples
let two = NonZero::new(2isize)?;
let four = NonZero::new(4isize)?;
let max = NonZero::new(isize::MAX)?;

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

pub const unsafe fn unchecked_mul(self, other: NonZero<isize>) -> NonZero<isize>

๐Ÿ”ฌThis is a nightly-only experimental API. (nonzero_ops)

Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behavior to overflow even if the result would wrap to a non-zero value. The behavior is undefined as soon as self * rhs > isize::MAX, or self * rhs < isize::MIN.

ยงExamples
#![feature(nonzero_ops)]

let two = NonZero::new(2isize)?;
let four = NonZero::new(4isize)?;

assert_eq!(four, unsafe { two.unchecked_mul(two) });
1.64.0 (const: 1.64.0) ยท Source

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

Raises non-zero value to an integer power. Checks for overflow and returns None on overflow. As a consequence, the result cannot wrap to zero.

ยงExamples
let three = NonZero::new(3isize)?;
let twenty_seven = NonZero::new(27isize)?;
let half_max = NonZero::new(isize::MAX / 2)?;

assert_eq!(Some(twenty_seven), three.checked_pow(3));
assert_eq!(None, half_max.checked_pow(3));
1.64.0 (const: 1.64.0) ยท Source

pub const fn saturating_pow(self, other: u32) -> NonZero<isize>

Raise non-zero value to an integer power. Return NonZero::<isize>::MIN or NonZero::<isize>::MAX on overflow.

ยงExamples
let three = NonZero::new(3isize)?;
let twenty_seven = NonZero::new(27isize)?;
let max = NonZero::new(isize::MAX)?;

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

Trait Implementationsยง

ยง

impl<'a> AddAnyAttr for NonZero<i128>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<i128>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<i128> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<i16>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<i16>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<i16> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<i32>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<i32>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<i32> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<i64>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<i64>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<i64> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<i8>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<i8>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<i8> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<isize>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<isize>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<isize> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<u128>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<u128>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<u128> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<u16>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<u16>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<u16> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<u32>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<u32>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<u32> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<u64>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<u64>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<u64> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<u8>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<u8>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<u8> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl<'a> AddAnyAttr for NonZero<usize>

ยง

type Output<SomeNewAttr: Attribute> = NonZero<usize>

The new type once the attribute has been added.
ยง

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <NonZero<usize> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
ยง

impl Archive for NonZero<i128>

ยง

type Archived = NonZero<i128>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<i128> as Archive>::Resolver, out: *mut <NonZero<i128> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<i16>

ยง

type Archived = NonZero<i16>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<i16> as Archive>::Resolver, out: *mut <NonZero<i16> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<i32>

ยง

type Archived = NonZero<i32>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<i32> as Archive>::Resolver, out: *mut <NonZero<i32> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<i64>

ยง

type Archived = NonZero<i64>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<i64> as Archive>::Resolver, out: *mut <NonZero<i64> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<i8>

ยง

type Archived = NonZero<i8>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<i8> as Archive>::Resolver, out: *mut <NonZero<i8> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<isize>

ยง

type Archived = <NonZero<i32> as Archive>::Archived

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<isize> as Archive>::Resolver, out: *mut <NonZero<isize> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<u128>

ยง

type Archived = NonZero<u128>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<u128> as Archive>::Resolver, out: *mut <NonZero<u128> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<u16>

ยง

type Archived = NonZero<u16>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<u16> as Archive>::Resolver, out: *mut <NonZero<u16> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<u32>

ยง

type Archived = NonZero<u32>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<u32> as Archive>::Resolver, out: *mut <NonZero<u32> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<u64>

ยง

type Archived = NonZero<u64>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<u64> as Archive>::Resolver, out: *mut <NonZero<u64> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<u8>

ยง

type Archived = NonZero<u8>

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<u8> as Archive>::Resolver, out: *mut <NonZero<u8> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl Archive for NonZero<usize>

ยง

type Archived = <NonZero<u32> as Archive>::Archived

The archived representation of this type. Read more
ยง

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
ยง

unsafe fn resolve( &self, _: usize, _: <NonZero<usize> as Archive>::Resolver, out: *mut <NonZero<usize> as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
ยง

impl AsULE for NonZero<i8>

ยง

type ULE = NonZero<u8>

The ULE type corresponding to Self. Read more
ยง

fn to_unaligned(self) -> <NonZero<i8> as AsULE>::ULE

Converts from Self to Self::ULE. Read more
ยง

fn from_unaligned(unaligned: <NonZero<i8> as AsULE>::ULE) -> NonZero<i8>

Converts from Self::ULE to Self. Read more
ยง

impl AsULE for NonZero<u8>

ยง

type ULE = NonZero<u8>

The ULE type corresponding to Self. Read more
ยง

fn to_unaligned(self) -> <NonZero<u8> as AsULE>::ULE

Converts from Self to Self::ULE. Read more
ยง

fn from_unaligned(unaligned: <NonZero<u8> as AsULE>::ULE) -> NonZero<u8>

Converts from Self::ULE to Self. Read more
ยง

impl AttributeValue for NonZero<i128>

ยง

type AsyncOutput = NonZero<i128>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<i128>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<i128>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<i128>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<i128> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<i128> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild( self, key: &str, state: &mut <NonZero<i128> as AttributeValue>::State, )

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<i128> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<i128> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i128> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<i16>

ยง

type AsyncOutput = NonZero<i16>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<i16>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<i16>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<i16>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<i16> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<i16> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<i16> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<i16> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<i16> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i16> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<i32>

ยง

type AsyncOutput = NonZero<i32>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<i32>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<i32>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<i32>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<i32> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<i32> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<i32> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<i32> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<i32> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i32> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<i64>

ยง

type AsyncOutput = NonZero<i64>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<i64>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<i64>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<i64>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<i64> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<i64> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<i64> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<i64> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<i64> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i64> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<i8>

ยง

type AsyncOutput = NonZero<i8>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<i8>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<i8>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<i8>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<i8> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<i8> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<i8> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<i8> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned(self) -> <NonZero<i8> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i8> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<isize>

ยง

type AsyncOutput = NonZero<isize>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<isize>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<isize>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<isize>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<isize> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<isize> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild( self, key: &str, state: &mut <NonZero<isize> as AttributeValue>::State, )

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<isize> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<isize> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<isize> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<u128>

ยง

type AsyncOutput = NonZero<u128>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<u128>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<u128>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<u128>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<u128> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<u128> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild( self, key: &str, state: &mut <NonZero<u128> as AttributeValue>::State, )

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<u128> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<u128> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u128> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<u16>

ยง

type AsyncOutput = NonZero<u16>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<u16>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<u16>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<u16>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<u16> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<u16> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<u16> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<u16> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<u16> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u16> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<u32>

ยง

type AsyncOutput = NonZero<u32>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<u32>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<u32>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<u32>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<u32> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<u32> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<u32> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<u32> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<u32> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u32> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<u64>

ยง

type AsyncOutput = NonZero<u64>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<u64>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<u64>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<u64>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<u64> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<u64> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<u64> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<u64> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<u64> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u64> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<u8>

ยง

type AsyncOutput = NonZero<u8>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<u8>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<u8>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<u8>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<u8> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<u8> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild(self, key: &str, state: &mut <NonZero<u8> as AttributeValue>::State)

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<u8> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned(self) -> <NonZero<u8> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u8> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
ยง

impl AttributeValue for NonZero<usize>

ยง

type AsyncOutput = NonZero<usize>

The type once all async data have loaded.
ยง

type State = (Element, NonZero<usize>)

The state that should be retained between building and rebuilding.
ยง

type Cloneable = NonZero<usize>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
ยง

type CloneableOwned = NonZero<usize>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
ยง

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
ยง

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
ยง

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
ยง

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <NonZero<usize> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
ยง

fn build( self, el: &Element, key: &str, ) -> <NonZero<usize> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
ยง

fn rebuild( self, key: &str, state: &mut <NonZero<usize> as AttributeValue>::State, )

Applies a new value for the attribute.
ยง

fn into_cloneable(self) -> <NonZero<usize> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
ยง

fn into_cloneable_owned( self, ) -> <NonZero<usize> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<usize> as AttributeValue>::AsyncOutput

โ€œResolvesโ€ this into a form that is not waiting for any asynchronous data.
1.28.0 ยท Sourceยง

impl<T> Binary for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.45.0 ยท Sourceยง

impl<T> BitOr<NonZero<T>> for T
where T: ZeroablePrimitive + BitOr<Output = T>,

Sourceยง

type Output = NonZero<T>

The resulting type after applying the | operator.
Sourceยง

fn bitor(self, rhs: NonZero<T>) -> <T as BitOr<NonZero<T>>>::Output

Performs the | operation. Read more
1.45.0 ยท Sourceยง

impl<T> BitOr<T> for NonZero<T>
where T: ZeroablePrimitive + BitOr<Output = T>,

Sourceยง

type Output = NonZero<T>

The resulting type after applying the | operator.
Sourceยง

fn bitor(self, rhs: T) -> <NonZero<T> as BitOr<T>>::Output

Performs the | operation. Read more
1.45.0 ยท Sourceยง

impl<T> BitOr for NonZero<T>
where T: ZeroablePrimitive + BitOr<Output = T>,

Sourceยง

type Output = NonZero<T>

The resulting type after applying the | operator.
Sourceยง

fn bitor(self, rhs: NonZero<T>) -> <NonZero<T> as BitOr>::Output

Performs the | operation. Read more
1.45.0 ยท Sourceยง

impl<T> BitOrAssign<T> for NonZero<T>
where T: ZeroablePrimitive, NonZero<T>: BitOr<T, Output = NonZero<T>>,

Sourceยง

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
1.45.0 ยท Sourceยง

impl<T> BitOrAssign for NonZero<T>
where T: ZeroablePrimitive, NonZero<T>: BitOr<Output = NonZero<T>>,

Sourceยง

fn bitor_assign(&mut self, rhs: NonZero<T>)

Performs the |= operation. Read more
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<i128>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<i128>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<i16>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<i16>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<i32>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<i32>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<i64>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<i64>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<i8>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<i8>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<isize>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<isize>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<u128>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<u128>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<u16>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<u16>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<u32>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<u32>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<u64>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<u64>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<u8>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<u8>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
Sourceยง

impl<'de, __Context> BorrowDecode<'de, __Context> for NonZero<usize>

Sourceยง

fn borrow_decode<D>(decoder: &mut D) -> Result<NonZero<usize>, DecodeError>
where D: BorrowDecoder<'de, Context = __Context>,

Attempt to decode this type with the given BorrowDecode.
1.28.0 ยท Sourceยง

impl<T> Clone for NonZero<T>

Sourceยง

fn clone(&self) -> NonZero<T>

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
1.28.0 ยท Sourceยง

impl<T> Debug for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<i16>
where DB: Database, i16: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<i16>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<i32>
where DB: Database, i32: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<i32>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<i64>
where DB: Database, i64: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<i64>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<i8>
where DB: Database, i8: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<i8>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<u16>
where DB: Database, u16: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<u16>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<u32>
where DB: Database, u32: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<u32>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<u64>
where DB: Database, u64: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<u64>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
ยง

impl<'r, DB> Decode<'r, DB> for NonZero<u8>
where DB: Database, u8: Decode<'r, DB>,

ยง

fn decode( value: <DB as Database>::ValueRef<'r>, ) -> Result<NonZero<u8>, Box<dyn Error + Send + Sync>>

Decode a new value of this type using a raw value from the database.
Sourceยง

impl<Context> Decode<Context> for NonZero<i128>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<i128>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<i16>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<i16>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<i32>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<i32>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<i64>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<i64>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<i8>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<i8>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<isize>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<isize>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<u128>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<u128>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<u16>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<u16>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<u32>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<u32>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<u64>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<u64>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<u8>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<u8>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<Context> Decode<Context> for NonZero<usize>

Sourceยง

fn decode<D>(decoder: &mut D) -> Result<NonZero<usize>, DecodeError>
where D: Decoder<Context = Context>,

Attempt to decode this type with the given Decode.
Sourceยง

impl<'de> Deserialize<'de> for NonZero<i128>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<i128>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<i16>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<i16>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<i32>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<i32>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<i64>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<i64>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<i8>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<i8>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<isize>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<isize>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<u128>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<u128>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<u16>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<u16>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<u32>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<u32>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<u64>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<u64>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<u8>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<u8>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<'de> Deserialize<'de> for NonZero<usize>

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<NonZero<usize>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
ยง

impl<D> Deserialize<NonZero<i128>, D> for NonZero<i128>
where D: Fallible + ?Sized,

ยง

fn deserialize( &self, _: &mut D, ) -> Result<NonZero<i128>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<i16>, D> for NonZero<i16>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<i16>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<i32>, D> for NonZero<i32>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<i32>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<i64>, D> for NonZero<i64>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<i64>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<i8>, D> for <NonZero<i8> as Archive>::Archived
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<i8>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<isize>, D> for <NonZero<isize> as Archive>::Archived
where D: Fallible + ?Sized,

ยง

fn deserialize( &self, _: &mut D, ) -> Result<NonZero<isize>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<u128>, D> for NonZero<u128>
where D: Fallible + ?Sized,

ยง

fn deserialize( &self, _: &mut D, ) -> Result<NonZero<u128>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<u16>, D> for NonZero<u16>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<u16>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<u32>, D> for NonZero<u32>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<u32>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<u64>, D> for NonZero<u64>
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<u64>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<u8>, D> for <NonZero<u8> as Archive>::Archived
where D: Fallible + ?Sized,

ยง

fn deserialize(&self, _: &mut D) -> Result<NonZero<u8>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<D> Deserialize<NonZero<usize>, D> for <NonZero<usize> as Archive>::Archived
where D: Fallible + ?Sized,

ยง

fn deserialize( &self, _: &mut D, ) -> Result<NonZero<usize>, <D as Fallible>::Error>

Deserializes using the given deserializer
1.28.0 ยท Sourceยง

impl<T> Display for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.51.0 ยท Sourceยง

impl Div<NonZero<u128>> for u128

Sourceยง

fn div(self, other: NonZero<u128>) -> u128

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = u128

The resulting type after applying the / operator.
1.51.0 ยท Sourceยง

impl Div<NonZero<u16>> for u16

Sourceยง

fn div(self, other: NonZero<u16>) -> u16

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = u16

The resulting type after applying the / operator.
1.51.0 ยท Sourceยง

impl Div<NonZero<u32>> for u32

Sourceยง

fn div(self, other: NonZero<u32>) -> u32

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = u32

The resulting type after applying the / operator.
1.51.0 ยท Sourceยง

impl Div<NonZero<u64>> for u64

Sourceยง

fn div(self, other: NonZero<u64>) -> u64

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = u64

The resulting type after applying the / operator.
1.51.0 ยท Sourceยง

impl Div<NonZero<u8>> for u8

Sourceยง

fn div(self, other: NonZero<u8>) -> u8

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = u8

The resulting type after applying the / operator.
1.51.0 ยท Sourceยง

impl Div<NonZero<usize>> for usize

Sourceยง

fn div(self, other: NonZero<usize>) -> usize

Same as self / other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

Sourceยง

type Output = usize

The resulting type after applying the / operator.
1.79.0 ยท Sourceยง

impl DivAssign<NonZero<u128>> for u128

Sourceยง

fn div_assign(&mut self, other: NonZero<u128>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

1.79.0 ยท Sourceยง

impl DivAssign<NonZero<u16>> for u16

Sourceยง

fn div_assign(&mut self, other: NonZero<u16>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

1.79.0 ยท Sourceยง

impl DivAssign<NonZero<u32>> for u32

Sourceยง

fn div_assign(&mut self, other: NonZero<u32>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

1.79.0 ยท Sourceยง

impl DivAssign<NonZero<u64>> for u64

Sourceยง

fn div_assign(&mut self, other: NonZero<u64>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

1.79.0 ยท Sourceยง

impl DivAssign<NonZero<u8>> for u8

Sourceยง

fn div_assign(&mut self, other: NonZero<u8>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

1.79.0 ยท Sourceยง

impl DivAssign<NonZero<usize>> for usize

Sourceยง

fn div_assign(&mut self, other: NonZero<usize>)

Same as self /= other.get(), but because other is a NonZero<_>, thereโ€™s never a runtime check for division-by-zero.

This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic.

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<i16>
where DB: Database, i16: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i16>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<i32>
where DB: Database, i32: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i32>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<i64>
where DB: Database, i64: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i64>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<i8>
where DB: Database, i8: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i8>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<u16>
where DB: Database, u16: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u16>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<u32>
where DB: Database, u32: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u32>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<u64>
where DB: Database, u64: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u64>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

ยง

impl<'q, DB> Encode<'q, DB> for NonZero<u8>
where DB: Database, u8: Encode<'q, DB>,

ยง

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Writes the value of self into buf without moving self. Read more
ยง

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u8>: Sized,

Writes the value of self into buf in the expected format for the database.
ยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

fn size_hint(&self) -> usize

Sourceยง

impl Encode for NonZero<i128>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<i16>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<i32>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<i64>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<i8>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<isize>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<u128>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<u16>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<u32>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<u64>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<u8>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl Encode for NonZero<usize>

Sourceยง

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
Sourceยง

impl<'v> From<&'v NonZero<i128>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<i128>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<i16>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<i16>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<i32>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<i32>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<i64>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<i64>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<i8>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<i8>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<isize>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<isize>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<u128>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<u128>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<u16>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<u16>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<u32>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<u32>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<u64>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<u64>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<u8>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<u8>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<&'v NonZero<usize>> for Value<'v>

Sourceยง

fn from(value: &'v NonZero<usize>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl From<Alignment> for NonZero<usize>

Sourceยง

fn from(align: Alignment) -> NonZero<usize>

Converts to this type from the input type.
1.31.0 (const: unstable) ยท Sourceยง

impl<T> From<NonZero<T>> for T

Sourceยง

fn from(nonzero: NonZero<T>) -> T

Converts to this type from the input type.
Sourceยง

impl<'v> From<NonZero<i128>> for Value<'v>

Sourceยง

fn from(value: NonZero<i128>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i16>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<i16>) -> NonZero<i128>

Converts NonZero<i16> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i16>> for NonZero<i32>

Sourceยง

fn from(small: NonZero<i16>) -> NonZero<i32>

Converts NonZero<i16> to NonZero<i32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i16>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<i16>) -> NonZero<i64>

Converts NonZero<i16> to NonZero<i64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i16>> for NonZero<isize>

Sourceยง

fn from(small: NonZero<i16>) -> NonZero<isize>

Converts NonZero<i16> to NonZero<isize> losslessly.

Sourceยง

impl<'v> From<NonZero<i16>> for Value<'v>

Sourceยง

fn from(value: NonZero<i16>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i32>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<i32>) -> NonZero<i128>

Converts NonZero<i32> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i32>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<i32>) -> NonZero<i64>

Converts NonZero<i32> to NonZero<i64> losslessly.

Sourceยง

impl<'v> From<NonZero<i32>> for Value<'v>

Sourceยง

fn from(value: NonZero<i32>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i64>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<i64>) -> NonZero<i128>

Converts NonZero<i64> to NonZero<i128> losslessly.

Sourceยง

impl<'v> From<NonZero<i64>> for Value<'v>

Sourceยง

fn from(value: NonZero<i64>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i8>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<i8>) -> NonZero<i128>

Converts NonZero<i8> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i8>> for NonZero<i16>

Sourceยง

fn from(small: NonZero<i8>) -> NonZero<i16>

Converts NonZero<i8> to NonZero<i16> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i8>> for NonZero<i32>

Sourceยง

fn from(small: NonZero<i8>) -> NonZero<i32>

Converts NonZero<i8> to NonZero<i32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i8>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<i8>) -> NonZero<i64>

Converts NonZero<i8> to NonZero<i64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<i8>> for NonZero<isize>

Sourceยง

fn from(small: NonZero<i8>) -> NonZero<isize>

Converts NonZero<i8> to NonZero<isize> losslessly.

Sourceยง

impl<'v> From<NonZero<i8>> for Value<'v>

Sourceยง

fn from(value: NonZero<i8>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<NonZero<isize>> for Value<'v>

Sourceยง

fn from(value: NonZero<isize>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<NonZero<u128>> for Value<'v>

Sourceยง

fn from(value: NonZero<u128>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<i128>

Converts NonZero<u16> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<i32>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<i32>

Converts NonZero<u16> to NonZero<i32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<i64>

Converts NonZero<u16> to NonZero<i64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<u128>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<u128>

Converts NonZero<u16> to NonZero<u128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<u32>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<u32>

Converts NonZero<u16> to NonZero<u32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<u64>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<u64>

Converts NonZero<u16> to NonZero<u64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u16>> for NonZero<usize>

Sourceยง

fn from(small: NonZero<u16>) -> NonZero<usize>

Converts NonZero<u16> to NonZero<usize> losslessly.

Sourceยง

impl<'v> From<NonZero<u16>> for Value<'v>

Sourceยง

fn from(value: NonZero<u16>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl From<NonZero<u32>> for Error

Sourceยง

fn from(code: NonZero<u32>) -> Error

Converts to this type from the input type.
Sourceยง

impl From<NonZero<u32>> for Error

Sourceยง

fn from(code: NonZero<u32>) -> Error

Converts to this type from the input type.
ยง

impl From<NonZero<u32>> for Id

ยง

fn from(value: NonZero<u32>) -> Id

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u32>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<u32>) -> NonZero<i128>

Converts NonZero<u32> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u32>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<u32>) -> NonZero<i64>

Converts NonZero<u32> to NonZero<i64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u32>> for NonZero<u128>

Sourceยง

fn from(small: NonZero<u32>) -> NonZero<u128>

Converts NonZero<u32> to NonZero<u128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u32>> for NonZero<u64>

Sourceยง

fn from(small: NonZero<u32>) -> NonZero<u64>

Converts NonZero<u32> to NonZero<u64> losslessly.

Sourceยง

impl From<NonZero<u32>> for QueueId

Sourceยง

fn from(id: NonZero<u32>) -> QueueId

Converts to this type from the input type.
Sourceยง

impl<'v> From<NonZero<u32>> for Value<'v>

Sourceยง

fn from(value: NonZero<u32>) -> Value<'v>

Converts to this type from the input type.
ยง

impl From<NonZero<u64>> for Id

ยง

fn from(value: NonZero<u64>) -> Id

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u64>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<u64>) -> NonZero<i128>

Converts NonZero<u64> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u64>> for NonZero<u128>

Sourceยง

fn from(small: NonZero<u64>) -> NonZero<u128>

Converts NonZero<u64> to NonZero<u128> losslessly.

Sourceยง

impl<'v> From<NonZero<u64>> for Value<'v>

Sourceยง

fn from(value: NonZero<u64>) -> Value<'v>

Converts to this type from the input type.
1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<i128>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<i128>

Converts NonZero<u8> to NonZero<i128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<i16>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<i16>

Converts NonZero<u8> to NonZero<i16> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<i32>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<i32>

Converts NonZero<u8> to NonZero<i32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<i64>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<i64>

Converts NonZero<u8> to NonZero<i64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<isize>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<isize>

Converts NonZero<u8> to NonZero<isize> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<u128>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<u128>

Converts NonZero<u8> to NonZero<u128> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<u16>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<u16>

Converts NonZero<u8> to NonZero<u16> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<u32>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<u32>

Converts NonZero<u8> to NonZero<u32> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<u64>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<u64>

Converts NonZero<u8> to NonZero<u64> losslessly.

1.41.0 (const: unstable) ยท Sourceยง

impl From<NonZero<u8>> for NonZero<usize>

Sourceยง

fn from(small: NonZero<u8>) -> NonZero<usize>

Converts NonZero<u8> to NonZero<usize> losslessly.

Sourceยง

impl<'v> From<NonZero<u8>> for Value<'v>

Sourceยง

fn from(value: NonZero<u8>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl<'v> From<NonZero<usize>> for Value<'v>

Sourceยง

fn from(value: NonZero<usize>) -> Value<'v>

Converts to this type from the input type.
Sourceยง

impl From<QueueId> for NonZero<u32>

Sourceยง

fn from(id: QueueId) -> NonZero<u32>

Converts to this type from the input type.
1.35.0 ยท Sourceยง

impl FromStr for NonZero<i128>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<i128>, <NonZero<i128> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<i16>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<i16>, <NonZero<i16> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<i32>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<i32>, <NonZero<i32> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<i64>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<i64>, <NonZero<i64> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<i8>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<i8>, <NonZero<i8> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<isize>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str( src: &str, ) -> Result<NonZero<isize>, <NonZero<isize> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<u128>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<u128>, <NonZero<u128> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<u16>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<u16>, <NonZero<u16> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<u32>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<u32>, <NonZero<u32> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<u64>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<u64>, <NonZero<u64> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<u8>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str(src: &str) -> Result<NonZero<u8>, <NonZero<u8> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.35.0 ยท Sourceยง

impl FromStr for NonZero<usize>

Sourceยง

type Err = ParseIntError

The associated error which can be returned from parsing.
Sourceยง

fn from_str( src: &str, ) -> Result<NonZero<usize>, <NonZero<usize> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
1.28.0 ยท Sourceยง

impl<T> Hash for NonZero<T>

Sourceยง

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

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
ยง

impl IntoBytes for NonZero<i128>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<i16>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<i32>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<i64>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<i8>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<isize>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<u128>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<u16>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<u32>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<u64>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<u8>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl IntoBytes for NonZero<usize>

ยง

fn as_bytes(&self) -> &[u8] โ“˜
where Self: Immutable,

Gets the bytes of this value. Read more
ยง

fn as_mut_bytes(&mut self) -> &mut [u8] โ“˜
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
ยง

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
ยง

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
ยง

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
ยง

impl KnownLayout for NonZero<i128>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<i16>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<i32>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<i64>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<i8>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<isize>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<u128>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<u16>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<u32>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<u64>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<u8>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
ยง

impl KnownLayout for NonZero<usize>

ยง

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
1.84.0 ยท Sourceยง

impl<T> LowerExp for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.28.0 ยท Sourceยง

impl<T> LowerHex for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<i128>

Sourceยง

type Output = <NonZero<i128> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<i128> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<i16>

Sourceยง

type Output = <NonZero<i16> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<i16> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<i32>

Sourceยง

type Output = <NonZero<i32> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<i32> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<i64>

Sourceยง

type Output = <NonZero<i64> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<i64> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<i8>

Sourceยง

type Output = <NonZero<i8> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<i8> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for &NonZero<isize>

Sourceยง

type Output = <NonZero<isize> as Neg>::Output

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> <NonZero<isize> as Neg>::Output

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<i128>

Sourceยง

type Output = NonZero<i128>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<i128>

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<i16>

Sourceยง

type Output = NonZero<i16>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<i16>

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<i32>

Sourceยง

type Output = NonZero<i32>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<i32>

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<i64>

Sourceยง

type Output = NonZero<i64>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<i64>

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<i8>

Sourceยง

type Output = NonZero<i8>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<i8>

Performs the unary - operation. Read more
1.71.0 ยท Sourceยง

impl Neg for NonZero<isize>

Sourceยง

type Output = NonZero<isize>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> NonZero<isize>

Performs the unary - operation. Read more
ยง

impl NicheBytes<1> for NonZero<u8>

1.28.0 ยท Sourceยง

impl<T> Octal for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.28.0 ยท Sourceยง

impl<T> Ord for NonZero<T>

Sourceยง

fn cmp(&self, other: &NonZero<T>) -> Ordering

This method returns an Ordering between self and other. Read more
Sourceยง

fn max(self, other: NonZero<T>) -> NonZero<T>

Compares and returns the maximum of two values. Read more
Sourceยง

fn min(self, other: NonZero<T>) -> NonZero<T>

Compares and returns the minimum of two values. Read more
Sourceยง

fn clamp(self, min: NonZero<T>, max: NonZero<T>) -> NonZero<T>

Restrict a value to a certain interval. Read more
1.28.0 (const: unstable) ยท Sourceยง

impl<T> PartialEq for NonZero<T>

Sourceยง

fn eq(&self, other: &NonZero<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
Sourceยง

fn ne(&self, other: &NonZero<T>) -> bool

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

impl<T> PartialOrd for NonZero<T>

Sourceยง

fn partial_cmp(&self, other: &NonZero<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Sourceยง

fn lt(&self, other: &NonZero<T>) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Sourceยง

fn le(&self, other: &NonZero<T>) -> bool

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

fn gt(&self, other: &NonZero<T>) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Sourceยง

fn ge(&self, other: &NonZero<T>) -> bool

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

impl PatchField for NonZero<i128>

ยง

fn patch_field( &mut self, new: NonZero<i128>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<i16>

ยง

fn patch_field( &mut self, new: NonZero<i16>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<i32>

ยง

fn patch_field( &mut self, new: NonZero<i32>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<i64>

ยง

fn patch_field( &mut self, new: NonZero<i64>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<i8>

ยง

fn patch_field( &mut self, new: NonZero<i8>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<isize>

ยง

fn patch_field( &mut self, new: NonZero<isize>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<u128>

ยง

fn patch_field( &mut self, new: NonZero<u128>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<u16>

ยง

fn patch_field( &mut self, new: NonZero<u16>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<u32>

ยง

fn patch_field( &mut self, new: NonZero<u32>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<u64>

ยง

fn patch_field( &mut self, new: NonZero<u64>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<u8>

ยง

fn patch_field( &mut self, new: NonZero<u8>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
ยง

impl PatchField for NonZero<usize>

ยง

fn patch_field( &mut self, new: NonZero<usize>, path: &StorePath, notify: &mut dyn FnMut(&StorePath), )

Patches the field with some new value, only notifying if the value has changed.
1.51.0 ยท Sourceยง

impl Rem<NonZero<u128>> for u128

Sourceยง

fn rem(self, other: NonZero<u128>) -> u128

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = u128

The resulting type after applying the % operator.
1.51.0 ยท Sourceยง

impl Rem<NonZero<u16>> for u16

Sourceยง

fn rem(self, other: NonZero<u16>) -> u16

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = u16

The resulting type after applying the % operator.
1.51.0 ยท Sourceยง

impl Rem<NonZero<u32>> for u32

Sourceยง

fn rem(self, other: NonZero<u32>) -> u32

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = u32

The resulting type after applying the % operator.
1.51.0 ยท Sourceยง

impl Rem<NonZero<u64>> for u64

Sourceยง

fn rem(self, other: NonZero<u64>) -> u64

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = u64

The resulting type after applying the % operator.
1.51.0 ยท Sourceยง

impl Rem<NonZero<u8>> for u8

Sourceยง

fn rem(self, other: NonZero<u8>) -> u8

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = u8

The resulting type after applying the % operator.
1.51.0 ยท Sourceยง

impl Rem<NonZero<usize>> for usize

Sourceยง

fn rem(self, other: NonZero<usize>) -> usize

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

Sourceยง

type Output = usize

The resulting type after applying the % operator.
1.79.0 ยท Sourceยง

impl RemAssign<NonZero<u128>> for u128

Sourceยง

fn rem_assign(&mut self, other: NonZero<u128>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

1.79.0 ยท Sourceยง

impl RemAssign<NonZero<u16>> for u16

Sourceยง

fn rem_assign(&mut self, other: NonZero<u16>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

1.79.0 ยท Sourceยง

impl RemAssign<NonZero<u32>> for u32

Sourceยง

fn rem_assign(&mut self, other: NonZero<u32>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

1.79.0 ยท Sourceยง

impl RemAssign<NonZero<u64>> for u64

Sourceยง

fn rem_assign(&mut self, other: NonZero<u64>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

1.79.0 ยท Sourceยง

impl RemAssign<NonZero<u8>> for u8

Sourceยง

fn rem_assign(&mut self, other: NonZero<u8>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

1.79.0 ยท Sourceยง

impl RemAssign<NonZero<usize>> for usize

Sourceยง

fn rem_assign(&mut self, other: NonZero<usize>)

This operation satisfies n % d == n - (n / d) * d, and cannot panic.

ยง

impl Render for NonZero<i128>

ยง

type State = NonZeroI128State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<i128> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<i128> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<i16>

ยง

type State = NonZeroI16State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<i16> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<i16> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<i32>

ยง

type State = NonZeroI32State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<i32> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<i32> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<i64>

ยง

type State = NonZeroI64State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<i64> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<i64> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<i8>

ยง

type State = NonZeroI8State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<i8> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<i8> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<isize>

ยง

type State = NonZeroIsizeState

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<isize> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<isize> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<u128>

ยง

type State = NonZeroU128State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<u128> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<u128> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<u16>

ยง

type State = NonZeroU16State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<u16> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<u16> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<u32>

ยง

type State = NonZeroU32State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<u32> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<u32> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<u64>

ยง

type State = NonZeroU64State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<u64> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<u64> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<u8>

ยง

type State = NonZeroU8State

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<u8> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<u8> as Render>::State)

Updates the view with new data.
ยง

impl Render for NonZero<usize>

ยง

type State = NonZeroUsizeState

The โ€œview stateโ€ for this type, which can be retained between updates. Read more
ยง

fn build(self) -> <NonZero<usize> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
ยง

fn rebuild(self, state: &mut <NonZero<usize> as Render>::State)

Updates the view with new data.
ยง

impl RenderHtml for NonZero<i128>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<i128>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<i128>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i128> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<i128> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<i128> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<i16>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<i16>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<i16>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i16> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<i16> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<i16> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<i32>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<i32>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<i32>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i32> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<i32> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<i32> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<i64>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<i64>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<i64>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i64> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<i64> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<i64> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<i8>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<i8>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<i8>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<i8> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<i8> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<i8> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<isize>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<isize>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<isize>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<isize> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<isize> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<isize> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<u128>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<u128>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<u128>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u128> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<u128> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<u128> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<u16>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<u16>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<u16>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u16> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<u16> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<u16> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<u32>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<u32>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<u32>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u32> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<u32> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<u32> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<u64>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<u64>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<u64>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u64> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<u64> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<u64> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<u8>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<u8>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<u8>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<u8> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<u8> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<u8> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl RenderHtml for NonZero<usize>

ยง

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
ยง

type AsyncOutput = NonZero<usize>

The type of the view after waiting for all asynchronous data to load.
ยง

type Owned = NonZero<usize>

An equivalent value that is 'static.
ยง

fn dry_resolve(&mut self)

โ€œRunsโ€ the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
ยง

async fn resolve(self) -> <NonZero<usize> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
ยง

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, _escape: bool, _mark_branches: bool, _extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
ยง

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <NonZero<usize> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn into_owned(self) -> <NonZero<usize> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
ยง

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
ยง

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
ยง

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
ยง

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
ยง

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
ยง

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
ยง

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
ยง

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
ยง

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
ยง

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
ยง

impl<S> Serialize<S> for NonZero<i128>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<i128> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<i16>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<i16> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<i32>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<i32> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<i64>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<i64> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<i8>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<i8> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<isize>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<isize> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<u128>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<u128> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<u16>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<u16> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<u32>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<u32> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<u64>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<u64> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<u8>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<u8> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
ยง

impl<S> Serialize<S> for NonZero<usize>
where S: Fallible + ?Sized,

ยง

fn serialize( &self, _: &mut S, ) -> Result<<NonZero<usize> as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Sourceยง

impl Serialize for NonZero<i128>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<i16>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<i32>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<i64>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<i8>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<isize>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<u128>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<u16>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<u32>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<u64>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<u8>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Serialize for NonZero<usize>

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
ยง

impl<'a> ToTemplate for NonZero<i128>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<i16>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<i32>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<i64>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<i8>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<isize>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<u128>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<u16>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<u32>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<u64>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<u8>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
ยง

impl<'a> ToTemplate for NonZero<usize>

ยง

const TEMPLATE: &'static str = " <!>"

The HTML content of the static template.
ยง

fn to_template( buf: &mut String, _class: &mut String, _style: &mut String, _inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
ยง

const CLASS: &'static str = ""

The class attribute content known at compile time.
ยง

const STYLE: &'static str = ""

The style attribute content known at compile time.
ยง

const LEN: usize = _

The length of the template.
ยง

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
Sourceยง

impl ToValue for NonZero<i128>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<i16>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<i32>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<i64>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<i8>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<isize>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<u128>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<u16>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<u32>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<u64>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<u8>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
Sourceยง

impl ToValue for NonZero<usize>

Sourceยง

fn to_value(&self) -> Value<'_>

Perform the conversion.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<i64>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i128>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<i128>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<i128>>>::Error>

Attempts to convert NonZero<i128> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i16>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<i16>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<i16>>>::Error>

Attempts to convert NonZero<i16> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i32>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<i32>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<i32>>>::Error>

Attempts to convert NonZero<i32> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i64>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<i64>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<i64>>>::Error>

Attempts to convert NonZero<i64> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<i8>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<i8>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<i8>>>::Error>

Attempts to convert NonZero<i8> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<i128>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<i128>, <NonZero<i128> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<i128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<i64>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<isize>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<isize>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<isize>>>::Error>

Attempts to convert NonZero<isize> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<i128>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<i128>, <NonZero<i128> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<i128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<i64>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u128>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<u128>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<u128>>>::Error>

Attempts to convert NonZero<u128> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u16>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<u16>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<u16>>>::Error>

Attempts to convert NonZero<u16> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u16>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<u16>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<u16>>>::Error>

Attempts to convert NonZero<u16> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u16>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<u16>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<u16>>>::Error>

Attempts to convert NonZero<u16> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u16>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<u16>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<u16>>>::Error>

Attempts to convert NonZero<u16> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u32>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<u32>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<u32>>>::Error>

Attempts to convert NonZero<u32> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<i64>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u64>> for NonZero<usize>

Sourceยง

fn try_from( value: NonZero<u64>, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<NonZero<u64>>>::Error>

Attempts to convert NonZero<u64> to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<u8>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<u8>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<u8>>>::Error>

Attempts to convert NonZero<u8> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

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

impl TryFrom<NonZero<usize>> for Alignment

Sourceยง

type Error = TryFromIntError

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

fn try_from( align: NonZero<usize>, ) -> Result<Alignment, <Alignment as TryFrom<NonZero<usize>>>::Error>

Performs the conversion.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<i128>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<i128>, <NonZero<i128> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<i128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<i16>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<i32>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<i64>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<i8>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<isize>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<u128>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<u16>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<u32>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<u64>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.49.0 (const: unstable) ยท Sourceยง

impl TryFrom<NonZero<usize>> for NonZero<u8>

Sourceยง

fn try_from( value: NonZero<usize>, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<NonZero<usize>>>::Error>

Attempts to convert NonZero<usize> to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<i128> for NonZero<i128>

Sourceยง

fn try_from( value: i128, ) -> Result<NonZero<i128>, <NonZero<i128> as TryFrom<i128>>::Error>

Attempts to convert i128 to NonZero<i128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<i16> for NonZero<i16>

Sourceยง

fn try_from( value: i16, ) -> Result<NonZero<i16>, <NonZero<i16> as TryFrom<i16>>::Error>

Attempts to convert i16 to NonZero<i16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<i32> for NonZero<i32>

Sourceยง

fn try_from( value: i32, ) -> Result<NonZero<i32>, <NonZero<i32> as TryFrom<i32>>::Error>

Attempts to convert i32 to NonZero<i32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<i64> for NonZero<i64>

Sourceยง

fn try_from( value: i64, ) -> Result<NonZero<i64>, <NonZero<i64> as TryFrom<i64>>::Error>

Attempts to convert i64 to NonZero<i64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<i8> for NonZero<i8>

Sourceยง

fn try_from( value: i8, ) -> Result<NonZero<i8>, <NonZero<i8> as TryFrom<i8>>::Error>

Attempts to convert i8 to NonZero<i8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<isize> for NonZero<isize>

Sourceยง

fn try_from( value: isize, ) -> Result<NonZero<isize>, <NonZero<isize> as TryFrom<isize>>::Error>

Attempts to convert isize to NonZero<isize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<u128> for NonZero<u128>

Sourceยง

fn try_from( value: u128, ) -> Result<NonZero<u128>, <NonZero<u128> as TryFrom<u128>>::Error>

Attempts to convert u128 to NonZero<u128>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<u16> for NonZero<u16>

Sourceยง

fn try_from( value: u16, ) -> Result<NonZero<u16>, <NonZero<u16> as TryFrom<u16>>::Error>

Attempts to convert u16 to NonZero<u16>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<u32> for NonZero<u32>

Sourceยง

fn try_from( value: u32, ) -> Result<NonZero<u32>, <NonZero<u32> as TryFrom<u32>>::Error>

Attempts to convert u32 to NonZero<u32>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<u64> for NonZero<u64>

Sourceยง

fn try_from( value: u64, ) -> Result<NonZero<u64>, <NonZero<u64> as TryFrom<u64>>::Error>

Attempts to convert u64 to NonZero<u64>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<u8> for NonZero<u8>

Sourceยง

fn try_from( value: u8, ) -> Result<NonZero<u8>, <NonZero<u8> as TryFrom<u8>>::Error>

Attempts to convert u8 to NonZero<u8>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
1.46.0 ยท Sourceยง

impl TryFrom<usize> for NonZero<usize>

Sourceยง

fn try_from( value: usize, ) -> Result<NonZero<usize>, <NonZero<usize> as TryFrom<usize>>::Error>

Attempts to convert usize to NonZero<usize>.

Sourceยง

type Error = TryFromIntError

The type returned in the event of a conversion error.
ยง

impl TryFromBytes for NonZero<i128>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<i16>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<i32>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<i64>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<i8>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<isize>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<u128>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<u16>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<u32>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<u64>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<u8>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl TryFromBytes for NonZero<usize>

ยง

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
ยง

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
ยง

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
ยง

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
ยง

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
ยง

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
ยง

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
ยง

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count. Read more
ยง

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
ยง

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
ยง

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
ยง

impl<DB> Type<DB> for NonZero<i16>
where DB: Database, i16: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<i32>
where DB: Database, i32: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<i64>
where DB: Database, i64: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<i8>
where DB: Database, i8: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<u16>
where DB: Database, u16: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<u32>
where DB: Database, u32: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<u64>
where DB: Database, u64: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl<DB> Type<DB> for NonZero<u8>
where DB: Database, u8: Type<DB>,

ยง

fn type_info() -> <DB as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
ยง

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl ULE for NonZero<u8>

ยง

fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>

Validates a byte slice, &[u8]. Read more
ยง

fn parse_bytes_to_slice(bytes: &[u8]) -> Result<&[Self], UleError>

Parses a byte slice, &[u8], and return it as &[Self] with the same lifetime. Read more
ยง

unsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]

Takes a byte slice, &[u8], and return it as &[Self] with the same lifetime, assuming that this byte slice has previously been run through [Self::parse_bytes_to_slice()] with success. Read more
ยง

fn slice_as_bytes(slice: &[Self]) -> &[u8] โ“˜

Given &[Self], returns a &[u8] with the same lifetime. Read more
1.84.0 ยท Sourceยง

impl<T> UpperExp for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
1.28.0 ยท Sourceยง

impl<T> UpperHex for NonZero<T>

Sourceยง

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

Formats the value using the given formatter. Read more
ยง

impl Value for NonZero<i128>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<i16>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<i32>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<i64>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<i8>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<isize>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<u128>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<u16>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<u32>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<u64>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<u8>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl Value for NonZero<usize>

ยง

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
ยง

impl<'a> ZeroMapKV<'a> for NonZero<i8>

ยง

type Container = ZeroVec<'a, NonZero<i8>>

The container that can be used with this type: [ZeroVec] or [VarZeroVec].
ยง

type Slice = ZeroSlice<NonZero<i8>>

ยง

type GetType = <NonZero<i8> as AsULE>::ULE

The type produced by Container::get() Read more
ยง

type OwnedType = NonZero<i8>

The type produced by Container::replace() and Container::remove(), also used during deserialization. If Self is human readable serialized, deserializing to Self::OwnedType should produce the same value once passed through Self::owned_as_self() Read more
ยง

impl<'a> ZeroMapKV<'a> for NonZero<u8>

ยง

type Container = ZeroVec<'a, NonZero<u8>>

The container that can be used with this type: [ZeroVec] or [VarZeroVec].
ยง

type Slice = ZeroSlice<NonZero<u8>>

ยง

type GetType = <NonZero<u8> as AsULE>::ULE

The type produced by Container::get() Read more
ยง

type OwnedType = NonZero<u8>

The type produced by Container::replace() and Container::remove(), also used during deserialization. If Self is human readable serialized, deserializing to Self::OwnedType should produce the same value once passed through Self::owned_as_self() Read more
ยง

impl Zeroize for NonZero<i128>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<i16>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<i32>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<i64>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<i8>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<isize>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<u128>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<u16>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<u32>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<u64>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<u8>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
ยง

impl Zeroize for NonZero<usize>

ยง

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not โ€œoptimized awayโ€ by the compiler.
1.28.0 ยท Sourceยง

impl<T> Copy for NonZero<T>

1.28.0 ยท Sourceยง

impl<T> Eq for NonZero<T>
where T: ZeroablePrimitive + Eq,

ยง

impl EqULE for NonZero<u8>

1.28.0 ยท Sourceยง

impl<T> Freeze for NonZero<T>

ยง

impl Immutable for NonZero<i128>

ยง

impl Immutable for NonZero<i16>

ยง

impl Immutable for NonZero<i32>

ยง

impl Immutable for NonZero<i64>

ยง

impl Immutable for NonZero<i8>

ยง

impl Immutable for NonZero<isize>

ยง

impl Immutable for NonZero<u128>

ยง

impl Immutable for NonZero<u16>

ยง

impl Immutable for NonZero<u32>

ยง

impl Immutable for NonZero<u64>

ยง

impl Immutable for NonZero<u8>

ยง

impl Immutable for NonZero<usize>

1.28.0 ยท Sourceยง

impl<T> RefUnwindSafe for NonZero<T>

1.28.0 ยท Sourceยง

impl<T> Send for NonZero<T>

Sourceยง

impl<T> StructuralPartialEq for NonZero<T>

1.28.0 ยท Sourceยง

impl<T> Sync for NonZero<T>

ยง

impl Unaligned for NonZero<i8>

ยง

impl Unaligned for NonZero<u8>

1.28.0 ยท Sourceยง

impl<T> Unpin for NonZero<T>

1.28.0 ยท Sourceยง

impl<T> UnwindSafe for NonZero<T>

Sourceยง

impl<T> UseCloned for NonZero<T>

Blanket Implementationsยง

Sourceยง

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Sourceยง

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Sourceยง

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
Sourceยง

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

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
ยง

impl<T> ArchivePointee for T

ยง

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
ยง

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
ยง

impl<T> ArchiveUnsized for T
where T: Archive,

ยง

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
ยง

type MetadataResolver = ()

The resolver for the metadata of this type. Read more
ยง

unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )

Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
ยง

unsafe fn resolve_unsized( &self, from: usize, to: usize, resolver: Self::MetadataResolver, out: *mut RelPtr<Self::Archived, <isize as Archive>::Archived>, )

Resolves a relative pointer to this value with the given from and to and writes it to the given output. Read more
Sourceยง

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Sourceยง

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Sourceยง

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Sourceยง

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
ยง

impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for V
where V: AddAnyAttr, Key: AttributeKey, Sig: IntoSplitSignal<Value = T>, T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static, Signal<BoolOrT<T>>: IntoProperty, <Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static, <Sig as IntoSplitSignal>::Write: Send + Clone + 'static, Element: GetValue<T>,

ยง

type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>

The type of the element with the two-way binding added.
ยง

fn bind( self, key: Key, signal: Sig, ) -> <V as BindAttribute<Key, Sig, T>>::Output

Adds a two-way binding to the element, which adds an attribute and an event listener to the element when the element is created or hydrated. 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
ยง

impl<T> CallHasher for T
where T: Hash + ?Sized,

ยง

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Sourceยง

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Sourceยง

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
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
ยง

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Sourceยง

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Sourceยง

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
ยง

impl<T, K, V> CustomAttribute<K, V> for T
where T: AddAnyAttr, K: CustomAttributeKey, V: AttributeValue,

ยง

fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>

Adds an HTML attribute by key and value.
ยง

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

ยง

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
where V: AddAnyAttr, D: IntoDirective<T, P>, P: Clone + 'static, T: 'static,

ยง

type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>

The type of the element with the directive added.
ยง

fn directive( self, handler: D, param: P, ) -> <V as DirectiveAttribute<T, P, D>>::Output

Adds a directive to the element, which runs some custom logic in the browser when the element is created or hydrated.
ยง

impl<T> Downcast for T
where T: Any,

ยง

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
ยง

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Anyโ€™s vtable from &Traitโ€™s.
ยง

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Anyโ€™s vtable from &mut Traitโ€™s.
ยง

impl<T> DowncastSend for T
where T: Any + Send,

ยง

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

ยง

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
ยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
ยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromAngle<T> for T

Sourceยง

fn from_angle(angle: T) -> T

Performs a conversion from angle.
ยง

impl<T> FromFormData for T

ยง

fn from_event(ev: &Event) -> Result<T, FromFormDataError>

Tries to deserialize the data, given only the submit event.
ยง

fn from_form_data(form_data: &FormData) -> Result<T, Error>

Tries to deserialize the data, given the actual form data.
ยง

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

ยง

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
ยง

impl<E, T, Request> FromReq<DeleteUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request> FromReq<GetUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request> FromReq<PatchUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request> FromReq<PostUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request> FromReq<PutUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Sourceยง

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Sourceยง

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
Sourceยง

impl<T> Hexable for T
where T: Serialize + for<'de> Deserialize<'de>,

ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoAngle<U> for T
where U: FromAngle<T>,

Sourceยง

fn into_angle(self) -> U

Performs a conversion into T.
ยง

impl<T> IntoAny for T
where T: Send + RenderHtml,

ยง

fn into_any(self) -> AnyView

Converts the view into a type-erased AnyView.
ยง

impl<T> IntoAttributeValue for T
where T: AttributeValue,

ยง

type Output = T

The attribute value into which this type can be converted.
ยง

fn into_attribute_value(self) -> <T as IntoAttributeValue>::Output

Consumes this value, transforming it into an attribute value.
Sourceยง

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Sourceยง

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Sourceยง

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Sourceยง

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Sourceยง

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Sourceยง

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self> โ“˜

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
ยง

impl<T> IntoMaybeErased for T
where T: RenderHtml,

ยง

type Output = T

The type of the output.
ยง

fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output

Converts the view into a type-erased view if in erased mode.
ยง

impl<T> IntoRender for T
where T: Render,

ยง

type Output = T

The renderable type into which this type can be converted.
ยง

fn into_render(self) -> <T as IntoRender>::Output

Consumes this value, transforming it into the renderable type.
ยง

impl<E, T, Request> IntoReq<DeleteUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<GetUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<PatchUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<PostUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<PutUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Sourceยง

impl<T> IntoStimulus<T> for T

Sourceยง

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
ยง

impl<T> IntoView for T
where T: Render + RenderHtml + Send,

ยง

fn into_view(self) -> View<T>

Wraps the inner type.
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
ยง

impl<T> Pointee for T

ยง

type Metadata = ()

The type for metadata in pointers and references to Self.
ยง

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

ยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
ยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
ยง

impl<T> SerializableKey for T

ยง

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
ยง

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Serializer + ?Sized,

ยง

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
ยง

fn serialize_metadata(&self, _: &mut S) -> Result<(), <S as Fallible>::Error>

Serializes the metadata for the given type.
ยง

impl<T> SliceAsULE for T
where T: EqULE,

ยง

fn slice_to_unaligned(slice: &[T]) -> Option<&[<T as AsULE>::ULE]>

Converts from &[Self] to &[Self::ULE] if possible. Read more
ยง

impl<T> StorageAccess<T> for T

ยง

fn as_borrowed(&self) -> &T

Borrows the value.
ยง

fn into_taken(self) -> T

Takes the value.
Sourceยง

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

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
ยง

impl<T> ToStringFallible for T
where T: Display,

ยง

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Sourceยง

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Sourceยง

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Sourceยง

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
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.
Sourceยง

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Sourceยง

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Sourceยง

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Sourceยง

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Sourceยง

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Sourceยง

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Sourceยง

impl<T> CondSerialize for T
where T: Serialize,

Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

ยง

impl<T> ErasedDestructor for T
where T: 'static,

ยง

impl<T> Fruit for T
where T: Send + Downcast,