Trait ctx::InnerContext
[−]
[src]
pub trait InnerContext: Future<Item = (), Error = ContextError> { fn deadline(&self) -> Option<Instant> { ... } fn value(&self) -> Option<&Any> { ... } fn parent(&self) -> Option<Context> { ... } }
A Context carries a deadline, a cancelation Future, and other values across API boundaries.
Provided Methods
fn deadline(&self) -> Option<Instant>
Returns the time when work done on behalf of this context should be canceled. Successive calls to deadline return the same result.
fn value(&self) -> Option<&Any>
Returns the value associated with this context for the expected type.
Context values should only be used for request-scoped data that transists processes and API boundaries and not for passing optional parameters to functions.
fn parent(&self) -> Option<Context>
Implementors
impl<V> InnerContext for WithValue<V> where
V: Any,impl InnerContext for WithCancel
impl InnerContext for WithDeadline