#[non_exhaustive]pub enum Error {
NotFound,
Unusable(Unusable),
}Expand description
Reason why the command search did not yield a target
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotFound
No command was found with the given name.
Unusable(Unusable)
A built-in was found, but it cannot be executed.
Note that the shell must not fall back to an external utility in this case: the built-in was found, so the command search is over.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn exit_status(self) -> ExitStatus
pub const fn exit_status(self) -> ExitStatus
Returns the exit status the shell should produce for this error.
This is 127 if no command was found, and the
Unusable::exit_status if a built-in was found but cannot be
executed.
Trait Implementations§
impl Copy for Error
Source§impl Display for Error
Describes the reason without naming the command.
impl Display for Error
Describes the reason without naming the command.
The result is a sentence fragment meant to be embedded in an error message that identifies the command, so it does not mention the name itself.
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more