[][src]Struct dangerous::display::ErrorDisplay

pub struct ErrorDisplay<'a, T> { /* fields omitted */ }

Provides configurable ErrorDetails formatting.

Implementations

impl<'a, 'i, T> ErrorDisplay<'a, T> where
    T: ErrorDetails<'i>, 
[src]

pub fn new(error: &'a T) -> Self[src]

Create a new ErrorDisplay given an ErrorDetails.

pub fn from_formatter(error: &'a T, f: &Formatter<'_>) -> Self[src]

Derive an ErrorDisplay from a fmt::Formatter with defaults.

pub fn banner(self, value: bool) -> Self[src]

Set whether or not a banner should printed around the error.

pub fn underline(self, value: bool) -> Self[src]

If enabled (enabled by default), writes an underline for an input span.

pub fn input_max_width(self, value: usize) -> Self[src]

Set the max-width for wrapping error output.

pub fn str_hint(self, value: bool) -> Self[src]

Hint to the formatter that the crate::Input is a UTF-8 str.

pub fn format(self, format: PreferredFormat) -> Self[src]

Set the preferred way to format the Input.

pub fn write<W>(&self, w: W) -> Result where
    W: Write
[src]

Writes the ErrorDetails to a writer with the chosen format.

Errors

Returns core::fmt::Error if failed to write.

Trait Implementations

impl<'a, T: Clone> Clone for ErrorDisplay<'a, T>[src]

impl<'a, 'i, T> Debug for ErrorDisplay<'a, T> where
    T: ErrorDetails<'i>, 
[src]

impl<'a, 'i, T> Display for ErrorDisplay<'a, T> where
    T: ErrorDetails<'i>, 
[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for ErrorDisplay<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for ErrorDisplay<'a, T> where
    T: Sync

impl<'a, T> Sync for ErrorDisplay<'a, T> where
    T: Sync

impl<'a, T> Unpin for ErrorDisplay<'a, T>

impl<'a, T> UnwindSafe for ErrorDisplay<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.