Trait FoldError

Source
pub trait FoldError {
    type Output;

Show 16 methods // Required methods fn no_id_match( &self, given: String, available: &'static [&'static str], ) -> Self::Output; fn ambiguous_id( &self, possible: &'static [&'static str], given: String, ) -> Self::Output; fn incomplete_path(&self, possible: &'static [&'static str]) -> Self::Output; fn trailing_path(&self, extra: String) -> Self::Output; fn no_input(&self) -> Self::Output; fn missing_required( &self, cmd: &'static str, arg: &'static str, ) -> Self::Output; fn bad_convert( &self, cmd: &'static str, arg: &'static str, inner: Self::Output, ) -> Self::Output; fn trailing(&self, cmd: &'static str, extra: String) -> Self::Output; fn subcommand( &self, subcmd: &'static str, inner: Self::Output, ) -> Self::Output; fn other(&self, error: Anyhow) -> Self::Output; // Provided methods fn fold_anyhow(&self, err: Anyhow) -> Self::Output { ... } fn fold_id_parse(&self, err: IdParseError) -> Self::Output { ... } fn fold_path_parse(&self, err: PathParseError) -> Self::Output { ... } fn fold_command_parse(&self, err: CommandParseError) -> Self::Output { ... } fn bad_path_id(&self, err: IdParseError) -> Self::Output { ... } fn bad_id(&self, err: IdParseError) -> Self::Output { ... }
}
Expand description

Helper trait for processing and formatting errors from docbot

Required Associated Types§

Source

type Output

The output type of a processed error

Required Methods§

Source

fn no_id_match( &self, given: String, available: &'static [&'static str], ) -> Self::Output

Handle a value of IdParseError::NoMatch

Source

fn ambiguous_id( &self, possible: &'static [&'static str], given: String, ) -> Self::Output

Handle a value of IdParseError::Ambiguous

Source

fn incomplete_path(&self, possible: &'static [&'static str]) -> Self::Output

Handle a value of [PathParseError::NoInput]

Source

fn trailing_path(&self, extra: String) -> Self::Output

Handle a value of PathParseError::Trailing

Source

fn no_input(&self) -> Self::Output

Handle a value of CommandParseError::NoInput

Source

fn missing_required(&self, cmd: &'static str, arg: &'static str) -> Self::Output

Source

fn bad_convert( &self, cmd: &'static str, arg: &'static str, inner: Self::Output, ) -> Self::Output

Source

fn trailing(&self, cmd: &'static str, extra: String) -> Self::Output

Handle a value of CommandParseError::Trailing

Source

fn subcommand(&self, subcmd: &'static str, inner: Self::Output) -> Self::Output

Source

fn other(&self, error: Anyhow) -> Self::Output

Handle an error that couldn’t be downcast to a docbot error

Provided Methods§

Source

fn fold_anyhow(&self, err: Anyhow) -> Self::Output

Handle an error which may or may not contain a docbot error

Source

fn fold_id_parse(&self, err: IdParseError) -> Self::Output

Handle an IdParseError

Source

fn fold_path_parse(&self, err: PathParseError) -> Self::Output

Handle a PathParseError

Source

fn fold_command_parse(&self, err: CommandParseError) -> Self::Output

Source

fn bad_path_id(&self, err: IdParseError) -> Self::Output

Handle a value of PathParseError::BadId

Source

fn bad_id(&self, err: IdParseError) -> Self::Output

Handle a value of CommandParseError::BadId

Implementors§