Struct otter_api_tests::imports::failure::Context[]

pub struct Context<D> where
    D: 'static + Display + Send + Sync
{ /* fields omitted */ }

An error with context around it.

The context is intended to be a human-readable, user-facing explanation for the error that has occurred. The underlying error is not assumed to be end-user-relevant information.

The Display impl for Context only prints the human-readable context, while the Debug impl also prints the underlying error.

Implementations

impl<D> Context<D> where
    D: 'static + Display + Send + Sync

pub fn new(context: D) -> Context<D>

Creates a new context without an underlying error message.

pub fn get_context(&self) -> &D

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;

Returns a reference to the context provided with this error.

pub fn map<F, T>(self, op: F) -> Context<T> where
    T: Display + Send + Sync + 'static,
    F: FnOnce(D) -> T, 

Maps Context<D> to Context<T> by applying a function to the contained context.

Trait Implementations

impl<D> Debug for Context<D> where
    D: 'static + Display + Send + Sync

impl<D> Display for Context<D> where
    D: 'static + Display + Send + Sync

impl<D> Fail for Context<D> where
    D: 'static + Display + Send + Sync

impl<D> From<D> for Context<D> where
    D: Display + Send + Sync + 'static, 

Auto Trait Implementations

impl<D> !RefUnwindSafe for Context<D>

impl<D> Send for Context<D>

impl<D> Sync for Context<D>

impl<D> Unpin for Context<D> where
    D: Unpin

impl<D> !UnwindSafe for Context<D>

Blanket Implementations

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

impl<T> AsFail for T where
    T: Fail

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

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

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<A> DynCastExt for A

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,