[][src]Struct index_ext::int::Int

#[repr(transparent)]pub struct Int<T>(pub T);

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]

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]

impl<T, U> Index<Int<T>> for [U] where
    T: IntSliceIndex<[U]> + IndexSealed, 
[src]

type Output = <T as IntSliceIndex<[U]>>::Output

The returned type after indexing.

impl<T, U> IndexMut<Int<T>> for [U] where
    T: IntSliceIndex<[U]> + IndexSealed, 
[src]

impl<T: Ord> Ord for Int<T>[src]

impl<T: PartialEq> PartialEq<Int<T>> for Int<T>[src]

impl<T: PartialOrd> PartialOrd<Int<T>> for Int<T>[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

impl<T> Sync for Int<T> where
    T: Sync

impl<T> Unpin for Int<T> where
    T: Unpin

Blanket Implementations

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

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

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

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

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

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.

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.