[][src]Struct endbasic_core::eval::Vars

pub struct Vars { /* fields omitted */ }

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

impl Default for Vars[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.