pub struct Environment { /* private fields */ }Expand description
Environment type that holds contexts, and the current environment. The current environment is the environment type. The contexts are the context type. The context type is a key-value pair of the environment type and the value. The value is the value for the environment type.
Implementations§
Source§impl Environment
Environment struct implementation
The Environment struct has the current environment and the contexts.
impl Environment
Environment struct implementation The Environment struct has the current environment and the contexts.
Sourcepub fn current_env(&self) -> &EnvType
pub fn current_env(&self) -> &EnvType
Get the current environment
Sourcepub fn context<M: ContextMarker>(&self) -> Option<&Context<M>>
pub fn context<M: ContextMarker>(&self) -> Option<&Context<M>>
Get the context for the context marker
Sourcepub fn current_value<M: ContextMarker>(&self) -> Option<M::Value>
pub fn current_value<M: ContextMarker>(&self) -> Option<M::Value>
Get the current value for the context marker
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Environment
impl Debug for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl !RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl !UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more