#[repr(transparent)]
pub struct LocationOrArgIndex { /* private fields */ }
Available on crate feature indexical only.

Implementations§

source§

impl LocationOrArgIndex

source

pub const MAX_INDEX: usize = 4_294_967_295usize

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.

source

pub const CHECKS_MAX_INDEX: bool = true

Does this index type assert if asked to construct an index larger than MAX_INDEX?

source

pub fn new(value: usize) -> Self

Construct this index type from a usize. Alias for from_usize.

source

pub fn from_raw(value: u32) -> Self

Construct this index type from the wrapped integer type.

source

pub fn from_foreign<F: Idx>(value: F) -> Self

Construct this index type from one in a different domain

source

pub const fn from_usize_unchecked(value: usize) -> Self

Construct from a usize without any checks.

source

pub const fn from_raw_unchecked(raw: u32) -> Self

Construct from the underlying type without any checks.

source

pub fn from_usize(value: usize) -> Self

Construct this index type from a usize.

source

pub const fn index(self) -> usize

Get the wrapped index as a usize.

source

pub const fn raw(self) -> u32

Get the wrapped index.

source

pub fn check_index(v: usize)

Asserts v <= Self::MAX_INDEX unless Self::CHECKS_MAX_INDEX is false.

Trait Implementations§

source§

impl Add<LocationOrArgIndex> for LocationOrArgIndex

§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
source§

fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the + operation. Read more
source§

impl Add<LocationOrArgIndex> for usize

§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
source§

fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the + operation. Read more
source§

impl Add<usize> for LocationOrArgIndex

§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
source§

fn add(self, other: usize) -> Self

Performs the + operation. Read more
source§

impl AddAssign<LocationOrArgIndex> for LocationOrArgIndex

source§

fn add_assign(&mut self, other: LocationOrArgIndex)

Performs the += operation. Read more
source§

impl AddAssign<usize> for LocationOrArgIndex

source§

fn add_assign(&mut self, other: usize)

Performs the += operation. Read more
source§

impl Clone for LocationOrArgIndex

source§

fn clone(&self) -> LocationOrArgIndex

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for LocationOrArgIndex

source§

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

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

impl From<LocationOrArgIndex> for usize

source§

fn from(v: LocationOrArgIndex) -> usize

Converts to this type from the input type.
source§

impl From<usize> for LocationOrArgIndex

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for LocationOrArgIndex

source§

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

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

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

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

impl Idx for LocationOrArgIndex

source§

fn from_usize(value: usize) -> Self

Construct an Index from a usize. This is equivalent to From. Read more
source§

fn index(self) -> usize

Get the underlying index. This is equivalent to Into
source§

impl Idx for LocationOrArgIndex

source§

fn new(idx: usize) -> Self

source§

fn index(self) -> usize

§

fn increment_by(&mut self, amount: usize)

§

fn plus(self, amount: usize) -> Self

source§

impl Ord for LocationOrArgIndex

source§

fn cmp(&self, other: &LocationOrArgIndex) -> Ordering

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

impl PartialEq<LocationOrArgIndex> for LocationOrArgIndex

source§

fn eq(&self, other: &LocationOrArgIndex) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<LocationOrArgIndex> for usize

source§

fn eq(&self, other: &LocationOrArgIndex) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<usize> for LocationOrArgIndex

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LocationOrArgIndex> for LocationOrArgIndex

source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<LocationOrArgIndex> for usize

source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<usize> for LocationOrArgIndex

source§

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

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

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

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

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

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

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

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

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

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

impl Rem<usize> for LocationOrArgIndex

§

type Output = LocationOrArgIndex

The resulting type after applying the % operator.
source§

fn rem(self, other: usize) -> Self

Performs the % operation. Read more
source§

impl Sub<LocationOrArgIndex> for LocationOrArgIndex

§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
source§

fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the - operation. Read more
source§

impl Sub<LocationOrArgIndex> for usize

§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
source§

fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the - operation. Read more
source§

impl Sub<usize> for LocationOrArgIndex

§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
source§

fn sub(self, other: usize) -> Self

Performs the - operation. Read more
source§

impl SubAssign<LocationOrArgIndex> for LocationOrArgIndex

source§

fn sub_assign(&mut self, other: LocationOrArgIndex)

Performs the -= operation. Read more
source§

impl SubAssign<usize> for LocationOrArgIndex

source§

fn sub_assign(&mut self, other: usize)

Performs the -= operation. Read more
source§

impl Copy for LocationOrArgIndex

source§

impl Eq for LocationOrArgIndex

source§

impl StructuralEq for LocationOrArgIndex

source§

impl StructuralPartialEq for LocationOrArgIndex

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<I, T> IdxSliceIndex<I, T> for Iwhere I: Idx,

§

type Output = T

source§

fn get( self, slice: &IndexSlice<I, [T]> ) -> Option<&<I as IdxSliceIndex<I, T>>::Output>

source§

fn get_mut( self, slice: &mut IndexSlice<I, [T]> ) -> Option<&mut <I as IdxSliceIndex<I, T>>::Output>

source§

fn index( self, slice: &IndexSlice<I, [T]> ) -> &<I as IdxSliceIndex<I, T>>::Output

source§

fn index_mut( self, slice: &mut IndexSlice<I, [T]> ) -> &mut <I as IdxSliceIndex<I, T>>::Output

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.