pub struct ErrorFormatter<'a> { /* private fields */ }Expand description
Unified error formatter that handles all error types consistently
Implementations§
Source§impl<'a> ErrorFormatter<'a>
impl<'a> ErrorFormatter<'a>
pub fn new(util_name: &'a str) -> Self
Sourcepub fn print_error_and_exit_with_callback<F>(
&self,
err: &Error,
exit_code: i32,
callback: F,
) -> !where
F: FnOnce(),
pub fn print_error_and_exit_with_callback<F>(
&self,
err: &Error,
exit_code: i32,
callback: F,
) -> !where
F: FnOnce(),
Print error with optional callback before exit
Sourcepub fn print_error(&self, err: &Error, exit_code: i32) -> i32
pub fn print_error(&self, err: &Error, exit_code: i32) -> i32
Print error and return exit code (no exit call)
Auto Trait Implementations§
impl<'a> Freeze for ErrorFormatter<'a>
impl<'a> RefUnwindSafe for ErrorFormatter<'a>
impl<'a> Send for ErrorFormatter<'a>
impl<'a> Sync for ErrorFormatter<'a>
impl<'a> Unpin for ErrorFormatter<'a>
impl<'a> UnsafeUnpin for ErrorFormatter<'a>
impl<'a> UnwindSafe for ErrorFormatter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more