[−][src]Struct dangerous::display::ErrorDisplay
Provides configurable ErrorDetails
formatting.
Implementations
impl<'a, 'i, T> ErrorDisplay<'a, T> where
T: ErrorDetails<'i>,
[src]
T: ErrorDetails<'i>,
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]
W: Write,
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]
fn clone(&self) -> ErrorDisplay<'a, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, 'i, T> Debug for ErrorDisplay<'a, T> where
T: ErrorDetails<'i>,
[src]
T: ErrorDetails<'i>,
impl<'a, 'i, T> Display for ErrorDisplay<'a, T> where
T: ErrorDetails<'i>,
[src]
T: ErrorDetails<'i>,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for ErrorDisplay<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for ErrorDisplay<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for ErrorDisplay<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for ErrorDisplay<'a, T>
impl<'a, T> UnwindSafe for ErrorDisplay<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,