[−][src]Struct index_vec::example_generated::wraps_u32::Idx32
Example documentation for the type
Methods
impl Idx32
[src]
pub const MAX_INDEX: usize
[src]
If Self::CHECKS_MAX_INDEX
is true, we'll assert if trying to
produce a value larger than this in any of the ctors that don't
have unchecked
in their name.
pub const CHECKS_MAX_INDEX: bool
[src]
Does this index type assert if asked to construct an index larger than MAX_INDEX?
pub fn new(value: usize) -> Self
[src]
Construct this index type from a usize. Alias for from_usize
.
pub fn from_raw(value: u32) -> Self
[src]
Construct this index type from the wrapped integer type.
pub fn from_foreign<F: Idx>(value: F) -> Self
[src]
Construct this index type from one in a different domain
pub const fn from_usize_unchecked(value: usize) -> Self
[src]
Construct from a usize without any checks.
pub const fn from_raw_unchecked(raw: u32) -> Self
[src]
Construct from the underlying type without any checks.
pub fn from_usize(value: usize) -> Self
[src]
Construct this index type from a usize.
pub fn index(self) -> usize
[src]
Get the wrapped index as a usize.
pub fn raw(self) -> u32
[src]
Get the wrapped index.
pub fn maybe_check_index(v: usize)
[src]
Asserts v <= Self::MAX_INDEX
unless Self::CHECKS_MAX_INDEX is false.
Trait Implementations
impl Idx for Idx32
[src]
fn from_usize(value: usize) -> Self
[src]
fn index(self) -> usize
[src]
impl From<Idx32> for usize
[src]
impl From<usize> for Idx32
[src]
impl From<Idx32> for u32
[src]
impl From<u32> for Idx32
[src]
impl PartialEq<Idx32> for Idx32
[src]
impl PartialEq<usize> for Idx32
[src]
impl PartialEq<Idx32> for usize
[src]
impl Eq for Idx32
[src]
impl Ord for Idx32
[src]
fn cmp(&self, other: &Idx32) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialOrd<Idx32> for Idx32
[src]
fn partial_cmp(&self, other: &Idx32) -> Option<Ordering>
[src]
fn lt(&self, other: &Idx32) -> bool
[src]
fn le(&self, other: &Idx32) -> bool
[src]
fn gt(&self, other: &Idx32) -> bool
[src]
fn ge(&self, other: &Idx32) -> bool
[src]
impl PartialOrd<usize> for Idx32
[src]
fn partial_cmp(&self, other: &usize) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Idx32> for usize
[src]
fn partial_cmp(&self, other: &Idx32) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Hash for Idx32
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Add<usize> for Idx32
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: usize) -> Self
[src]
impl Add<Idx32> for usize
[src]
type Output = Idx32
The resulting type after applying the +
operator.
fn add(self, other: Idx32) -> Idx32
[src]
impl Sub<usize> for Idx32
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: usize) -> Self
[src]
impl Sub<Idx32> for usize
[src]
type Output = Idx32
The resulting type after applying the -
operator.
fn sub(self, other: Idx32) -> Idx32
[src]
impl Rem<usize> for Idx32
[src]
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, other: usize) -> Self
[src]
impl AddAssign<usize> for Idx32
[src]
fn add_assign(&mut self, other: usize)
[src]
impl SubAssign<usize> for Idx32
[src]
fn sub_assign(&mut self, other: usize)
[src]
impl Debug for Idx32
[src]
impl Copy for Idx32
[src]
impl Clone for Idx32
[src]
fn clone(&self) -> Idx32
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.