#[repr(transparent)]pub struct Intex<T>(pub T);
Expand description
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 Intex
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::Intex;
let val = [0u8; 2][Intex(1u32)];
This is a transparent wrapper.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: Ord> Ord for Intex<T>
impl<T: Ord> Ord for Intex<T>
source§impl<T: PartialEq> PartialEq for Intex<T>
impl<T: PartialEq> PartialEq for Intex<T>
source§impl<T: PartialOrd> PartialOrd for Intex<T>
impl<T: PartialOrd> PartialOrd for Intex<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl<T: Copy> Copy for Intex<T>
impl<T: Eq> Eq for Intex<T>
impl<T> StructuralEq for Intex<T>
impl<T> StructuralPartialEq for Intex<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Intex<T>where
T: RefUnwindSafe,
impl<T> Send for Intex<T>where
T: Send,
impl<T> Sync for Intex<T>where
T: Sync,
impl<T> Unpin for Intex<T>where
T: Unpin,
impl<T> UnwindSafe for Intex<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more