#[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 variable and adds it to the symbol table.
§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 variables.
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
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more