pub struct VarTable {
pub variables: Vec<Variable>,
}Expand description
Struct for the built-in vartable type
Fields§
§variables: Vec<Variable>Vector of variables
Implementations§
Source§impl VarTable
impl VarTable
Sourcepub fn merge(&mut self, vartable: &VarTable) -> Result<(), Box<dyn Error>>
pub fn merge(&mut self, vartable: &VarTable) -> Result<(), Box<dyn Error>>
Merge with another vartable, overwriting all existing variables with ones found in the other vartable
Sourcepub fn add(&mut self, var: Variable) -> Result<(), Box<dyn Error>>
pub fn add(&mut self, var: Variable) -> Result<(), Box<dyn Error>>
Add a variable to the VarTable, fail if the variable exists
Sourcepub fn remove(&mut self, id: &str) -> Result<(), Box<dyn Error>>
pub fn remove(&mut self, id: &str) -> Result<(), Box<dyn Error>>
Remove a variable from the VarTable given just the id, fail if the variable doesn’t exist
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VarTable
impl<'de> Deserialize<'de> for VarTable
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
impl StructuralPartialEq for VarTable
Auto Trait Implementations§
impl Freeze for VarTable
impl RefUnwindSafe for VarTable
impl Send for VarTable
impl Sync for VarTable
impl Unpin for VarTable
impl UnwindSafe for VarTable
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