pub enum FailureClass {
CommandNotFound,
Syntax,
Encoding,
}Expand description
One class of shell failure a reader can act on.
Variants§
CommandNotFound
The interpreter found no command by the name the line gave.
Syntax
The interpreter could not parse the line.
Encoding
The output held bytes that were not UTF-8, written down as U+FFFD.
Implementations§
Source§impl FailureClass
impl FailureClass
Sourcepub fn of(
interpreter: &str,
exit_code: i64,
stdout: &str,
stderr: &str,
) -> Option<Self>
pub fn of( interpreter: &str, exit_code: i64, stdout: &str, stderr: &str, ) -> Option<Self>
Which class a shell result’s failure falls in, or None for a
success and for a failure no rule recognises.
The exit code is read first, then the error ids that do not change with the display language, then the replacement character, and English text last: cmd prints its syntax errors in the language Windows is set to, so on another language they stay unclassified rather than this file carrying a second copy of Microsoft’s text.
Trait Implementations§
Source§impl Clone for FailureClass
impl Clone for FailureClass
impl Copy for FailureClass
Source§impl Debug for FailureClass
impl Debug for FailureClass
impl Eq for FailureClass
Source§impl Ord for FailureClass
impl Ord for FailureClass
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FailureClass
impl PartialEq for FailureClass
Source§impl PartialOrd for FailureClass
impl PartialOrd for FailureClass
impl StructuralPartialEq for FailureClass
Auto Trait Implementations§
impl Freeze for FailureClass
impl RefUnwindSafe for FailureClass
impl Send for FailureClass
impl Sync for FailureClass
impl Unpin for FailureClass
impl UnsafeUnpin for FailureClass
impl UnwindSafe for FailureClass
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