Struct endbasic_core::syms::Symbols

source ·
pub struct Symbols { /* private fields */ }
Expand description

Storage for all symbols that exist at runtime.

Implementations§

Registers the given builtin command.

Given that commands cannot be defined at runtime, specifying a non-unique name results in a panic.

Registers the given builtin function.

Given that functions cannot be defined at runtime, specifying a non-unique name results in a panic.

Returns the mapping of all symbols.

Clears all user-defined symbols.

Defines a new variable name of type vartype. The variable must not yet exist.

Defines a new array name of type subtype with dimensions. The array must not yet exist, and the name may not overlap function or variable names.

Obtains the value of a symbol or None if it is not defined.

Returns an error if the type annotation in the symbol reference does not match its type.

Obtains the value of a symbol or None if it is not defined.

Obtains the value of a symbol or None if it is not defined.

Returns an error if the type annotation in the symbol reference does not match its type.

Obtains the value of a variable.

Returns an error if the variable is not defined, if the referenced symbol is not a variable, or if the type annotation in the variable reference does not match the type of the value that the variable contains.

Adds a type annotation to the symbol reference if the symbol is already defined and the reference lacks one.

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.

Unsets the symbol name irrespective of its type.

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.