pub trait ToIndex<T: IndexedValue, M> {
// Required method
fn to_index(self, domain: &IndexedDomain<T>) -> T::Index;
}Expand description
Implicit conversions from elements to indexes.
Commonly used in the IndexSet and IndexMatrix interfaces.
Note that we cannot use the Into trait because this conversion requires
the IndexedDomain as input.
The M type parameter is a coherence hack to ensure the two blanket implementations
do not conflict.
Required Methods§
Sourcefn to_index(self, domain: &IndexedDomain<T>) -> T::Index
fn to_index(self, domain: &IndexedDomain<T>) -> T::Index
Converts self to an index over T.