[][src]Struct hcontext::HContext

pub struct HContext { /* fields omitted */ }

Hierarchical context.

Methods

impl HContext
[src]

pub fn new() -> Self
[src]

Created new empty context.

pub fn from(parent: HContext) -> Self
[src]

Wraps parent context into new child context. Parent context is consumed.

pub fn with(
    self,
    key: impl Into<String>,
    val: impl Any + Sync + Send + 'static
) -> Self
[src]

Sets propery of current context to provided value. If current context has a parent context and property name is used also in parent context, it will be hidded by new value but not replaced. When is parent context unvinded again it will return original property value.

pub fn get<T: 'static>(&self, key: &str) -> Option<&T>
[src]

Gets value of property. It recursivelly traverses through chain of parents unit values is found or hierarchy ends

pub fn unwind(self) -> Option<Self>
[src]

Retreives parent context from current one. Current context is consumed.

Auto Trait Implementations

impl Send for HContext

impl Sync for HContext

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]