pub struct Index<'id, I: Idx = u32, Emptiness = NonEmpty> { /* private fields */ }
Expand description
A branded index.
Index<'id>
only indexes the container instantiated with the exact same
lifetime for the parameter 'id
created by the scope
function.
The type parameter Emptiness
determines if the index is followable.
A NonEmpty
index points to a valid element. An Unknown
index is
unknown, or it points to an edge index (one past the end).
Implementations§
Trait Implementations§
Source§impl<'id, Array: TrustedContainer + ?Sized, I: Idx> Index<Index<'id, I>> for Container<'id, Array>
impl<'id, Array: TrustedContainer + ?Sized, I: Idx> Index<Index<'id, I>> for Container<'id, Array>
Source§impl<'id, I: Idx, Emptiness> Ord for Index<'id, I, Emptiness>
impl<'id, I: Idx, Emptiness> Ord for Index<'id, I, Emptiness>
Source§impl<'id, I: Idx, P, Q> PartialOrd<Index<'id, I, Q>> for Index<'id, I, P>
impl<'id, I: Idx, P, Q> PartialOrd<Index<'id, I, Q>> for Index<'id, I, P>
impl<'id, I: Idx, Emptiness> Copy for Index<'id, I, Emptiness>
impl<'id, I: Idx, Emptiness> Eq for Index<'id, I, Emptiness>
Auto Trait Implementations§
impl<'id, I, Emptiness> Freeze for Index<'id, I, Emptiness>where
I: Freeze,
impl<'id, I, Emptiness> RefUnwindSafe for Index<'id, I, Emptiness>where
I: RefUnwindSafe,
Emptiness: RefUnwindSafe,
impl<'id, I, Emptiness> Send for Index<'id, I, Emptiness>
impl<'id, I, Emptiness> Sync for Index<'id, I, Emptiness>
impl<'id, I, Emptiness> Unpin for Index<'id, I, Emptiness>
impl<'id, I = u32, Emptiness = NonEmpty> !UnwindSafe for Index<'id, I, Emptiness>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Array> TrustedItem<&Array> for T
impl<T, Array> TrustedItem<&Array> for T
type Unit = <T as TrustedItem<Array>>::Unit
Source§fn vet<'id, I>(
idx: I,
container: &Container<'id, &Array>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
fn vet<'id, I>(
idx: I,
container: &Container<'id, &Array>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
Vet an index for being on item boundaries. Read more
Source§impl<T> TrustedItem<[T]> for T
impl<T> TrustedItem<[T]> for T
type Unit = T
Source§fn vet<'id, I>(
idx: I,
container: &Container<'id, [T]>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
fn vet<'id, I>(
idx: I,
container: &Container<'id, [T]>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
Vet an index for being on item boundaries. Read more
Source§impl<T, Array> TrustedItem<Box<Array>> for T
impl<T, Array> TrustedItem<Box<Array>> for T
type Unit = <T as TrustedItem<Array>>::Unit
Source§fn vet<'id, I>(
idx: I,
container: &Container<'id, Box<Array>>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
fn vet<'id, I>(
idx: I,
container: &Container<'id, Box<Array>>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
Vet an index for being on item boundaries. Read more
Source§impl<T> TrustedItem<Vec<T>> for Twhere
T: TrustedItem<[T]>,
impl<T> TrustedItem<Vec<T>> for Twhere
T: TrustedItem<[T]>,
type Unit = <T as TrustedItem<[T]>>::Unit
Source§fn vet<'id, I>(
idx: I,
container: &Container<'id, Vec<T>>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
fn vet<'id, I>(
idx: I,
container: &Container<'id, Vec<T>>,
) -> Result<Index<'id, I, Unknown>, IndexError>where
I: Idx,
Vet an index for being on item boundaries. Read more