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§
Required Methods§
Sourcefn no_id_match(
&self,
given: String,
available: &'static [&'static str],
) -> Self::Output
fn no_id_match( &self, given: String, available: &'static [&'static str], ) -> Self::Output
Handle a value of IdParseError::NoMatch
Sourcefn ambiguous_id(
&self,
possible: &'static [&'static str],
given: String,
) -> Self::Output
fn ambiguous_id( &self, possible: &'static [&'static str], given: String, ) -> Self::Output
Handle a value of IdParseError::Ambiguous
Sourcefn incomplete_path(&self, possible: &'static [&'static str]) -> Self::Output
fn incomplete_path(&self, possible: &'static [&'static str]) -> Self::Output
Handle a value of [PathParseError::NoInput
]
Sourcefn trailing_path(&self, extra: String) -> Self::Output
fn trailing_path(&self, extra: String) -> Self::Output
Handle a value of PathParseError::Trailing
Sourcefn no_input(&self) -> Self::Output
fn no_input(&self) -> Self::Output
Handle a value of CommandParseError::NoInput
Sourcefn missing_required(&self, cmd: &'static str, arg: &'static str) -> Self::Output
fn missing_required(&self, cmd: &'static str, arg: &'static str) -> Self::Output
Handle a value of CommandParseError::MissingRequired
Sourcefn bad_convert(
&self,
cmd: &'static str,
arg: &'static str,
inner: Self::Output,
) -> Self::Output
fn bad_convert( &self, cmd: &'static str, arg: &'static str, inner: Self::Output, ) -> Self::Output
Handle a value of CommandParseError::BadConvert
Sourcefn trailing(&self, cmd: &'static str, extra: String) -> Self::Output
fn trailing(&self, cmd: &'static str, extra: String) -> Self::Output
Handle a value of CommandParseError::Trailing
Sourcefn subcommand(&self, subcmd: &'static str, inner: Self::Output) -> Self::Output
fn subcommand(&self, subcmd: &'static str, inner: Self::Output) -> Self::Output
Handle a value of CommandParseError::Subcommand
Provided Methods§
Sourcefn fold_anyhow(&self, err: Anyhow) -> Self::Output
fn fold_anyhow(&self, err: Anyhow) -> Self::Output
Handle an error which may or may not contain a docbot
error
Sourcefn fold_id_parse(&self, err: IdParseError) -> Self::Output
fn fold_id_parse(&self, err: IdParseError) -> Self::Output
Handle an IdParseError
Sourcefn fold_path_parse(&self, err: PathParseError) -> Self::Output
fn fold_path_parse(&self, err: PathParseError) -> Self::Output
Handle a PathParseError
Sourcefn fold_command_parse(&self, err: CommandParseError) -> Self::Output
fn fold_command_parse(&self, err: CommandParseError) -> Self::Output
Handle a CommandParseError
Sourcefn bad_path_id(&self, err: IdParseError) -> Self::Output
fn bad_path_id(&self, err: IdParseError) -> Self::Output
Handle a value of PathParseError::BadId
Sourcefn bad_id(&self, err: IdParseError) -> Self::Output
fn bad_id(&self, err: IdParseError) -> Self::Output
Handle a value of CommandParseError::BadId