Trait index_ext::IntSliceIndex [−][src]
pub trait IntSliceIndex<T: ?Sized>: SealedSliceIndex<T> { }
Expand description
A trait for integer based indices.
Any integer can be used as a fallible index where a machine word can be used by first trying to
convert it into a usize and then indexing with the original method. From the point of the
user, the effect is not much different. If 10usize is out-of-bounds then so is any other
integer representing the number 10, no matter the allowed magnitude of its type. The same
holds for integers that permit negative indices.
The output type of the indexing operation is an element or a slice respectively.
This trait enables the generic Int::get_int method.
Implementations on Foreign Types
Implementors
impl<T, U> IntSliceIndex<[U]> for TryIndex<T> where
T: TryInto<usize>,
T::Error: Into<TryFromIntError>,