Struct bounded_types::BoundedUsize[][src]

pub struct BoundedUsize<const MIN: usize, const MAX: usize>(_);
Expand description

An usize element that is forced to be within the inclusive range MIN..=MAX.

Implementations

impl<const MIN: usize, const MAX: usize> BoundedUsize<MIN, MAX>[src]

#[must_use]
pub fn unchecked(&self) -> usize
[src]

Returns the numeric value stored in the struct, but overrides the bounds check.

pub fn is_in_bounds(val: &impl PartialOrd<usize>) -> bool[src]

Function that returns whether a value is within the bounds.

Methods from Deref<Target = Result<usize, OutOfBoundsError<MIN, MAX>>>

#[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"]
pub const fn is_ok(&self) -> bool
1.0.0 (const: 1.48.0)[src]

Returns true if the result is Ok.

Examples

Basic usage:

let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_ok(), true);

let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_ok(), false);

#[must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead"]
pub const fn is_err(&self) -> bool
1.0.0 (const: 1.48.0)[src]

Returns true if the result is Err.

Examples

Basic usage:

let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_err(), false);

let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_err(), true);

#[must_use]
pub fn contains<U>(&self, x: &U) -> bool where
    U: PartialEq<T>, 
[src]

🔬 This is a nightly-only experimental API. (option_result_contains)

Returns true if the result is an Ok value containing the given value.

Examples

#![feature(option_result_contains)]

let x: Result<u32, &str> = Ok(2);
assert_eq!(x.contains(&2), true);

let x: Result<u32, &str> = Ok(3);
assert_eq!(x.contains(&2), false);

let x: Result<u32, &str> = Err("Some error message");
assert_eq!(x.contains(&2), false);

#[must_use]
pub fn contains_err<F>(&self, f: &F) -> bool where
    F: PartialEq<E>, 
[src]

🔬 This is a nightly-only experimental API. (result_contains_err)

Returns true if the result is an Err value containing the given value.

Examples

#![feature(result_contains_err)]

let x: Result<u32, &str> = Ok(2);
assert_eq!(x.contains_err(&"Some error message"), false);

let x: Result<u32, &str> = Err("Some error message");
assert_eq!(x.contains_err(&"Some error message"), true);

let x: Result<u32, &str> = Err("Some other error message");
assert_eq!(x.contains_err(&"Some error message"), false);

pub const fn as_ref(&self) -> Result<&T, &E>1.0.0 (const: 1.48.0)[src]

Converts from &Result<T, E> to Result<&T, &E>.

Produces a new Result, containing a reference into the original, leaving the original in place.

Examples

Basic usage:

let x: Result<u32, &str> = Ok(2);
assert_eq!(x.as_ref(), Ok(&2));

let x: Result<u32, &str> = Err("Error");
assert_eq!(x.as_ref(), Err(&"Error"));

pub fn iter(&self) -> Iter<'_, T>1.0.0[src]

Returns an iterator over the possibly contained value.

The iterator yields one value if the result is Result::Ok, otherwise none.

Examples

Basic usage:

let x: Result<u32, &str> = Ok(7);
assert_eq!(x.iter().next(), Some(&7));

let x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter().next(), None);

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>1.47.0[src]

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

Coerces the Ok variant of the original Result via Deref and returns the new Result.

Examples

let x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&str, &u32> = Ok("hello");
assert_eq!(x.as_deref(), y);

let x: Result<String, u32> = Err(42);
let y: Result<&str, &u32> = Err(&42);
assert_eq!(x.as_deref(), y);

Trait Implementations

impl<const MIN: usize, const MAX: usize> AsRef<Result<usize, OutOfBoundsError<MIN, MAX>>> for BoundedUsize<MIN, MAX>[src]

fn as_ref(&self) -> &Result<usize, OutOfBoundsError<MIN, MAX>>[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> Borrow<Result<usize, OutOfBoundsError<MIN, MAX>>> for BoundedUsize<MIN, MAX>[src]

fn borrow(&self) -> &Result<usize, OutOfBoundsError<MIN, MAX>>[src]

Immutably borrows from an owned value. Read more

impl<const MIN: usize, const MAX: usize> Clone for BoundedUsize<MIN, MAX>[src]

fn clone(&self) -> BoundedUsize<MIN, MAX>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<const MIN: usize, const MAX: usize> Debug for BoundedUsize<MIN, MAX>[src]

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

Formats the value using the given formatter. Read more

impl<const MIN: usize, const MAX: usize> Deref for BoundedUsize<MIN, MAX>[src]

type Target = Result<usize, OutOfBoundsError<MIN, MAX>>

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<'de, const MIN: usize, const MAX: usize> Deserialize<'de> for BoundedUsize<MIN, MAX>[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<const MIN: usize, const MAX: usize> Display for BoundedUsize<MIN, MAX>[src]

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

Formats the value using the given formatter. Read more

impl<const MIN: usize, const MAX: usize> From<i128> for BoundedUsize<MIN, MAX>[src]

fn from(other: i128) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<i16> for BoundedUsize<MIN, MAX>[src]

fn from(other: i16) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<i32> for BoundedUsize<MIN, MAX>[src]

fn from(other: i32) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<i64> for BoundedUsize<MIN, MAX>[src]

fn from(other: i64) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<i8> for BoundedUsize<MIN, MAX>[src]

fn from(other: i8) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<isize> for BoundedUsize<MIN, MAX>[src]

fn from(other: isize) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<u128> for BoundedUsize<MIN, MAX>[src]

fn from(other: u128) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<u16> for BoundedUsize<MIN, MAX>[src]

fn from(other: u16) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<u32> for BoundedUsize<MIN, MAX>[src]

fn from(other: u32) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<u64> for BoundedUsize<MIN, MAX>[src]

fn from(other: u64) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<u8> for BoundedUsize<MIN, MAX>[src]

fn from(other: u8) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> From<usize> for BoundedUsize<MIN, MAX>[src]

fn from(other: usize) -> Self[src]

Performs the conversion.

impl<const MIN: usize, const MAX: usize> FromStr for BoundedUsize<MIN, MAX>[src]

type Err = <usize as FromStr>::Err

The associated error which can be returned from parsing.

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

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

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for u8[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for i64[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for i128[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for isize[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for u16[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for u32[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for u64[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for u128[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for usize[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for i8[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for i16[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<BoundedUsize<MIN, MAX>> for i32[src]

Inferred through symmetry.

fn eq(&self, other: &BoundedUsize<MIN, MAX>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<i128> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &i128) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<i16> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &i16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<i32> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &i32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<i64> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &i64) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<i8> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &i8) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<isize> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &isize) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<u128> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &u128) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<u16> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &u16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<u32> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &u32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<u64> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &u64) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<u8> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &u8) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialEq<usize> for BoundedUsize<MIN, MAX>[src]

fn eq(&self, other: &usize) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for u8[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for i64[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for i128[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for isize[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for u16[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for u32[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for u64[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for u128[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for usize[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for i8[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for i16[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<BoundedUsize<MIN, MAX>> for i32[src]

Inferred through assymetry.

fn partial_cmp(&self, other: &BoundedUsize<MIN, MAX>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<i128> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &i128) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<i16> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &i16) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<i32> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &i32) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<i64> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &i64) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<i8> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &i8) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<isize> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &isize) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<u128> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &u128) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<u16> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &u16) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<u32> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &u32) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<u64> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &u64) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<u8> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &u8) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> PartialOrd<usize> for BoundedUsize<MIN, MAX>[src]

fn partial_cmp(&self, other: &usize) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<const MIN: usize, const MAX: usize> Serialize for BoundedUsize<MIN, MAX>[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<const MIN: usize, const MAX: usize> Copy for BoundedUsize<MIN, MAX>[src]

Auto Trait Implementations

impl<const MIN: usize, const MAX: usize> RefUnwindSafe for BoundedUsize<MIN, MAX>

impl<const MIN: usize, const MAX: usize> Send for BoundedUsize<MIN, MAX>

impl<const MIN: usize, const MAX: usize> Sync for BoundedUsize<MIN, MAX>

impl<const MIN: usize, const MAX: usize> Unpin for BoundedUsize<MIN, MAX>

impl<const MIN: usize, const MAX: usize> UnwindSafe for BoundedUsize<MIN, MAX>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]