[][src]Struct litto::env::KvEnv

pub struct KvEnv<V: Trace>(_);

Recursive key-value environment.

Keys are string names.

An environment has an optional parent environment, which enables scopes. An environment exclusive to a function is useful for implementing closures.

Methods

impl<V: Trace + Clone> KvEnv<V>[src]

pub fn get(&self, name: &str) -> Option<V>[src]

Resolve a name. Ignore parent environments.

pub fn set_local(&self, name: &str, value: V)[src]

Set a name to a value. Ignore parent environments.

pub fn set(&self, name: &str, value: V)[src]

Set a name to a value.

  • If the name exists in this environment, it will be updated in-place.
  • If the name exists in a parent environment, the closest parent environment will be updated.
  • If the name does not exist in this or any of the parent environments, it will be added in this environment.

pub fn nested(&self) -> Self[src]

Create a nested environment. The current environment will be the parent of the returned environment.

Trait Implementations

impl<V: Clone + Trace> Clone for KvEnv<V>[src]

impl<V: Trace> Default for KvEnv<V>[src]

impl<V: Trace> Trace for KvEnv<V>[src]

Auto Trait Implementations

impl<V> !RefUnwindSafe for KvEnv<V>

impl<V> !Send for KvEnv<V>

impl<V> !Sync for KvEnv<V>

impl<V> Unpin for KvEnv<V>

impl<V> UnwindSafe for KvEnv<V> where
    V: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.