#[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: TTrait Implementations§
Source§impl<T: Ord> Ord for Intex<T>
impl<T: Ord> Ord for Intex<T>
Source§impl<T: PartialOrd> PartialOrd for Intex<T>
impl<T: PartialOrd> PartialOrd for Intex<T>
impl<T: Copy> Copy for Intex<T>
impl<T: Eq> Eq for Intex<T>
impl<T> StructuralPartialEq for Intex<T>
Auto Trait Implementations§
impl<T> Freeze for Intex<T>where
T: Freeze,
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