#[non_exhaustive]pub struct SymbolTable { /* private fields */ }
Expand description
Stores all named variables in a Minion model alongside their domains.
Named variables referenced in constraints must be in the symbol table for the model to be valid. In the future, this will raise some sort of type error.
Implementations§
Source§impl SymbolTable
impl SymbolTable
Sourcepub fn add_var(&mut self, name: VarName, vartype: VarDomain) -> Option<()>
pub fn add_var(&mut self, name: VarName, vartype: VarDomain) -> Option<()>
Creates a new search variable and adds it to the symbol table.
§Returns
If a variable already exists with the given name, None
is returned.
Sourcepub fn add_aux_var(&mut self, name: VarName, vartype: VarDomain) -> Option<()>
pub fn add_aux_var(&mut self, name: VarName, vartype: VarDomain) -> Option<()>
Creates a new auxiliary variable and adds it to the symbol table.
This variable will excluded from Minions search and printing order.
§Returns
If a variable already exists with the given name, None
is returned.
Sourcepub fn get_vartype(&self, name: VarName) -> Option<VarDomain>
pub fn get_vartype(&self, name: VarName) -> Option<VarDomain>
Sourcepub fn get_variable_order(&self) -> Vec<VarName> ⓘ
pub fn get_variable_order(&self) -> Vec<VarName> ⓘ
Gets the canonical ordering of all variables.
Sourcepub fn get_search_variable_order(&self) -> Vec<VarName> ⓘ
pub fn get_search_variable_order(&self) -> Vec<VarName> ⓘ
Gets the canonical ordering of search variables (i.e excluding aux vars).
pub fn contains(&self, name: VarName) -> bool
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SymbolTable
impl Debug for SymbolTable
Source§impl PartialEq for SymbolTable
impl PartialEq for SymbolTable
impl Eq for SymbolTable
impl StructuralPartialEq for SymbolTable
Auto Trait Implementations§
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin for SymbolTable
impl UnwindSafe for SymbolTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes