pub struct Array<Identifier = String> {
pub name: String,
pub contents: Vec<Literal<Identifier>>,
pub ann: Vec<Annotation<Identifier>>,
pub defined: bool,
pub introduced: bool,
}Expand description
A definition of a named array literal in FlatZinc
FlatZinc Arrays are a simple (one-dimensional) sequence of Literals.
These values are stored as the Array::contents member. Additional
information, in the form of Annotations, from the MiniZinc model is
stored in Array::ann when present. When Array::defined is set to
true, then
Fields§
§name: StringThe optional public name of the array literal.
This is None for arrays inlined within constraints.
contents: Vec<Literal<Identifier>>The values stored within the array literal
ann: Vec<Annotation<Identifier>>List of annotations
defined: boolThis field is set to true when there is a constraint that has been
marked as defining this array.
introduced: boolThis field is set to true when the array has been introduced by the
MiniZinc compiler, rather than being explicitly defined at the top-level
of the MiniZinc model.
Implementations§
Source§impl<Identifier> Array<Identifier>
impl<Identifier> Array<Identifier>
Sourcepub fn cloned_key(self: &Arc<Self>) -> ArcKey<Self>
pub fn cloned_key(self: &Arc<Self>) -> ArcKey<Self>
Clones this array reference into an ArcKey.
This is useful when storing arrays in collections such as
HashMap, HashSet, and
BTreeMap, where the key should identify
the specific parsed array object rather than its contents or name.
This method clones the Arc reference count and keeps the original
array reference usable by the caller.
The resulting key uses the allocation / pointer identity of this
Arc. Two arrays with the same name and equal contents will
therefore compare as different keys if they are stored in different
allocations.
During FlatZinc parsing and deserialization, this crate guarantees that
identical top-level arrays are allocated only once. In those cases,
ArcKey is a good fit for keying collections by the canonical parsed
array object.