pub trait FromIndexKey: Sized {
// Required method
fn from_index_key(k: &IndexKey) -> Self;
}Expand description
Typed projection of an IndexKey. Implementations panic when the
key’s shape does not match the target type, the same contract as
crate::indexed::IndexedVar indexing on a missing key.
Used by the indexed-family constraint! macro (and similar rule helpers) to
give the closure typed indices directly:
ⓘ
constraint!(m, supply[(p, m) in &plants * &markets], {
// p, m are native String, no manual unpack
...
});Required Methods§
fn from_index_key(k: &IndexKey) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".