Skip to main content

FormatError

Trait FormatError 

Source
pub trait FormatError {
    type Error;

    // Required methods
    fn format_error(&self, spec: &ConversionSpec, error: &Self::Error) -> String;
    fn format_missing(&self, spec: &ConversionSpec) -> String;
    fn format_type_error(&self, spec: &ConversionSpec, arg: &Arg) -> String;
}
Expand description

A trait for formatting conversion specifiers that failed, were skipped, or were missing.

Required Associated Types§

Source

type Error

The domain-specific error type.

Required Methods§

Source

fn format_error(&self, spec: &ConversionSpec, error: &Self::Error) -> String

Renders a conversion specifier that failed with a domain-specific error.

Source

fn format_missing(&self, spec: &ConversionSpec) -> String

Renders a conversion specifier that was missing from the supplied arguments.

Source

fn format_type_error(&self, spec: &ConversionSpec, arg: &Arg) -> String

Renders a conversion specifier that decoded successfully but failed to format (type mismatch).

Implementors§