[−][src]Struct yolk::environment::Environment
Represents a Yolk program environment.
Methods
impl Environment
[src]
pub fn new() -> Environment
[src]
Creates an empty environment.
pub fn context(&self) -> Context
[src]
Gets the context of an environment.
pub fn variable(&self, ident: &str) -> Result<Value, TranspileError>
[src]
Gets the value of a variable from an environment.
pub fn function(&self, ident: &str) -> Result<Function, TranspileError>
[src]
Gets a function from an environment.
pub fn import(&mut self, ident: &str) -> Result<(), TranspileError>
[src]
Imports a variable into an environment.
pub fn define(
&mut self,
ident: &str,
function: Function
) -> Result<(), TranspileError>
[src]
&mut self,
ident: &str,
function: Function
) -> Result<(), TranspileError>
Defines a function in an environmnent.
pub fn let_value(
&mut self,
ident: &str,
value: Value
) -> Result<Vec<YololNode>, TranspileError>
[src]
&mut self,
ident: &str,
value: Value
) -> Result<Vec<YololNode>, TranspileError>
Assigns a value to a variable in an environment.
Returns the associated Yolol assign statements.
pub fn export(&mut self, ident: &str) -> Result<(), TranspileError>
[src]
Exports a variable from an environment.
Tracks which variable identifiers must not be eliminated.
Trait Implementations
impl Clone for Environment
[src]
fn clone(&self) -> Environment
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Environment
[src]
Auto Trait Implementations
impl Send for Environment
impl Unpin for Environment
impl Sync for Environment
impl RefUnwindSafe for Environment
impl UnwindSafe for Environment
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,