pub trait Get<Index> {
type Component;
// Required methods
fn get_ref(&self, index: Index) -> &Self::Component;
fn get_mut(&mut self, index: Index) -> &mut Self::Component;
// Provided methods
fn get(self, index: Index) -> Self::Component
where Self: Sized,
Self::Component: Copy { ... }
fn set(&mut self, index: Index, component: Self::Component) { ... }
}
Expand description
Generic access to a structure’s components.