[−][src]Struct litto::env::KvEnv
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,
V: UnwindSafe,
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,
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> 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, 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>,