pub trait Enumerable {
type Element;
// Required methods
fn len(&self) -> usize;
fn element_ref(&self, index: usize) -> &Self::Element;
fn element_copy(&self, index: usize) -> Self::Element;
// Provided method
fn element(&self, index: usize) -> &Self::Element { ... }
}Expand description
Has length and indexed access.
Required Associated Types§
Required Methods§
Sourcefn element_ref(&self, index: usize) -> &Self::Element
fn element_ref(&self, index: usize) -> &Self::Element
Get element by reference.
Sourcefn element_copy(&self, index: usize) -> Self::Element
fn element_copy(&self, index: usize) -> Self::Element
Get element copying it.