pub trait At<T> {
// Required methods
fn at(&self, index: impl IntoIndex) -> &T;
fn try_at(&self, index: impl IntoIndex) -> Option<&T>;
}
Expand description
Trait to get a reference to an element at a given index.
The index can be of any type that implements IntoIndex
.
Note that “out of bounds” below applies to indices that either don’t exist or where the
impl IntoIndex
fails because the value can not be converted to usize
.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.