pub trait Table {
type Item;
// Required methods
fn insert(&mut self, name: &str, value: Self::Item);
fn is_empty(&self) -> bool;
fn contains_key(&self, name: &str) -> bool;
fn get(&self, name: &str) -> Option<&Self::Item>;
}
Expand description
§Table
A simple trait used for accessing table-like objects.
This trait is used internally for the machine’s constant table. As long as your table type implements this trait then you’ll be cool. Meaning you can choose whatever language semantics you want with regards constants.
Required Associated Types§
Required Methods§
Sourcefn insert(&mut self, name: &str, value: Self::Item)
fn insert(&mut self, name: &str, value: Self::Item)
Insert a value into the table using a string key.
Sourcefn contains_key(&self, name: &str) -> bool
fn contains_key(&self, name: &str) -> bool
Does the table contain the key or not?