Module index

Source
Expand description

Traits for accessing elements by usize indexes.

There are several traits, with a core distinction being whether the returned reference depends on the lifetime of &self. For one trait Index the result does not depend on this lifetime. There is a third trait IndexMut that allows mutable access, that may be less commonly implemented.

Traitsยง

CopyAs
Types that can be converted into another type by copying.
Index
A type that can be accessed by usize but without borrowing self.
IndexAs
IndexMut
A type that can be mutably accessed by usize.