pub struct SymbolTable {
pub domains: IndexMap<String, DomainInfo>,
pub predicates: IndexMap<String, PredicateInfo>,
pub variables: IndexMap<String, String>,
}Expand description
Symbol table containing all domain, predicate, and variable information
Fields§
§domains: IndexMap<String, DomainInfo>§predicates: IndexMap<String, PredicateInfo>§variables: IndexMap<String, String>Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn new() -> Self
pub fn add_domain(&mut self, domain: DomainInfo) -> Result<()>
pub fn add_predicate(&mut self, predicate: PredicateInfo) -> Result<()>
pub fn bind_variable( &mut self, var: impl Into<String>, domain: impl Into<String>, ) -> Result<()>
pub fn get_domain(&self, name: &str) -> Option<&DomainInfo>
pub fn get_predicate(&self, name: &str) -> Option<&PredicateInfo>
pub fn get_variable_domain(&self, var: &str) -> Option<&str>
pub fn infer_from_expr(&mut self, expr: &TLExpr) -> Result<()>
pub fn to_json(&self) -> Result<String>
pub fn from_json(json: &str) -> Result<Self>
pub fn to_yaml(&self) -> Result<String>
pub fn from_yaml(yaml: &str) -> Result<Self>
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a duplicate 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 Default for SymbolTable
impl Default for SymbolTable
Source§impl<'de> Deserialize<'de> for SymbolTable
impl<'de> Deserialize<'de> for SymbolTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ProductDomainExt for SymbolTable
impl ProductDomainExt for SymbolTable
Source§fn add_product_domain(
&mut self,
name: impl Into<String>,
product: ProductDomain,
) -> Result<(), AdapterError>
fn add_product_domain( &mut self, name: impl Into<String>, product: ProductDomain, ) -> Result<(), AdapterError>
Add a product domain to the symbol table. Read more
Source§fn get_product_domain(&self, name: &str) -> Option<&ProductDomain>
fn get_product_domain(&self, name: &str) -> Option<&ProductDomain>
Get a product domain by name. Read more
Source§fn list_product_domains(&self) -> Vec<(&str, &ProductDomain)>
fn list_product_domains(&self) -> Vec<(&str, &ProductDomain)>
List all product domains in the symbol table.
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