[][src]Struct status::AdhocContext

pub struct AdhocContext { /* fields omitted */ }

Adhoc Context.

Unlike most Contexts, this is meant to be opaque and not programmatically specify the status. It is only good for displaying the data to the user when prototyping before one transitions to more formal Contexts.

Note: This is the default Context for [Status].

Methods

impl AdhocContext[src]

pub fn new() -> Self[src]

Create an empty Context.

pub fn insert<V>(self, key: &'static str, value: V) -> Self where
    V: AdhocValue + Clone
[src]

Add Display-only context for a [Status]

If an equivalent key already exists: the key remains and retains in its place in the order, its corresponding value is updated with value.

If no equivalent key existed: the new key-value pair is inserted, last in order.

Example

let c = status::AdhocContext::new().insert("Expected value", 10);
println!("{}", c);

Trait Implementations

impl Context for AdhocContext[src]

impl Clone for AdhocContext[src]

impl Default for AdhocContext[src]

impl Display for AdhocContext[src]

impl Debug for AdhocContext[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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

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

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