pub trait SizedIndex<I: Uint>: Index<I> {
// Required method
fn length(&self) -> I;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn get(&self, i: I) -> Option<&Self::Output> { ... }
fn last(&self) -> Option<&Self::Output> { ... }
fn index_iter(self) -> IndexIter<I, Self> ⓘ
where Self: Sized { ... }
}Expand description
Required Methods§
Provided Methods§
fn is_empty(&self) -> bool
Sourcefn get(&self, i: I) -> Option<&Self::Output>
fn get(&self, i: I) -> Option<&Self::Output>
Element i if it is below length, and None past
the end, where Index panics: the bound every reader of an element
that may be absent would otherwise write for itself.
fn last(&self) -> Option<&Self::Output>
fn index_iter(self) -> IndexIter<I, Self> ⓘwhere
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".