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() -> SymbolTable
pub fn add_domain(&mut self, domain: DomainInfo) -> Result<(), Error>
pub fn add_predicate(&mut self, predicate: PredicateInfo) -> Result<(), Error>
pub fn bind_variable( &mut self, var: impl Into<String>, domain: impl Into<String>, ) -> Result<(), Error>
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<(), Error>
pub fn to_json(&self) -> Result<String, Error>
pub fn from_json(json: &str) -> Result<SymbolTable, Error>
pub fn to_yaml(&self) -> Result<String, Error>
pub fn from_yaml(yaml: &str) -> Result<SymbolTable, Error>
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§fn default() -> SymbolTable
fn default() -> SymbolTable
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SymbolTable
impl<'de> Deserialize<'de> for SymbolTable
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolTable, <__D as Deserializer<'de>>::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.
Source§impl Serialize for SymbolTable
impl Serialize for SymbolTable
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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