[−][src]Struct index_ext::int::Int
An adaptor for ops::Index
that uses this crate's IntSliceIndex
instead of the standard one.
This struct can be used to index a slice with an arbitrary integer type, using the standard
indexing syntax. It is also constructed by the Int
method exported in the crate root. The
indexing operation will first try to convert the number of a usize
index and then do the
usual indexing.
use index_ext::int::Int; let val = [0u8; 2][Int(1u32)];
This is a transparent wrapper.
Trait Implementations
impl<T: Clone> Clone for Int<T>
[src]
fn clone(&self) -> Int<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for Int<T>
[src]
impl<T: Debug> Debug for Int<T>
[src]
impl<T: Default> Default for Int<T>
[src]
impl<T: Eq> Eq for Int<T>
[src]
impl<T: Hash> Hash for Int<T>
[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<T, U> Index<Int<T>> for [U] where
T: IntSliceIndex<[U]> + IndexSealed,
[src]
T: IntSliceIndex<[U]> + IndexSealed,
type Output = <T as IntSliceIndex<[U]>>::Output
The returned type after indexing.
fn index(&self, idx: Int<T>) -> &Self::Output
[src]
impl<T, U> IndexMut<Int<T>> for [U] where
T: IntSliceIndex<[U]> + IndexSealed,
[src]
T: IntSliceIndex<[U]> + IndexSealed,
impl<T: Ord> Ord for Int<T>
[src]
fn cmp(&self, other: &Int<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq> PartialEq<Int<T>> for Int<T>
[src]
impl<T: PartialOrd> PartialOrd<Int<T>> for Int<T>
[src]
fn partial_cmp(&self, other: &Int<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Int<T>) -> bool
[src]
fn le(&self, other: &Int<T>) -> bool
[src]
fn gt(&self, other: &Int<T>) -> bool
[src]
fn ge(&self, other: &Int<T>) -> bool
[src]
impl<T> StructuralEq for Int<T>
[src]
impl<T> StructuralPartialEq for Int<T>
[src]
Auto Trait Implementations
impl<T> Send for Int<T> where
T: Send,
T: Send,
impl<T> Sync for Int<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Int<T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,