[−][src]Struct endbasic_core::eval::Vars
Storage for all variables that exist at runtime.
Implementations
impl Vars
[src]
pub fn clear(&mut self)
[src]
Clears all variables.
pub fn get(&self, vref: &VarRef) -> Result<&Value>
[src]
Obtains the value of a variable.
Returns an error if the variable is not defined, or if the type annotation in the variable reference does not match the type of the value that the variable contains.
pub fn is_empty(&self) -> bool
[src]
Returns true if this contains no variables.
pub fn set(&mut self, vref: &VarRef, value: Value) -> Result<()>
[src]
Sets the value of a variable.
If vref
contains a type annotation, the type of the value must be compatible with that
type annotation.
If the variable is already defined, then the type of the new value must be compatible with the existing variable. In other words: a variable cannot change types while it's alive.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Vars
impl Send for Vars
impl Sync for Vars
impl Unpin for Vars
impl UnwindSafe for Vars
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,