pub enum Divert {
Continue {
count: usize,
},
Break {
count: usize,
},
Return(Option<ExitStatus>),
Interrupt(Option<ExitStatus>),
Exit(Option<ExitStatus>),
Abort(Option<ExitStatus>),
}Expand description
Result of interrupted command execution.
Divert implements Ord. Values are ordered by severity.
Variants§
Continue
Continue the current loop.
Fields
Break
Break the current loop.
Fields
Return(Option<ExitStatus>)
Return from the current function or script.
Interrupt(Option<ExitStatus>)
Interrupt the current shell execution environment.
This is the same as Exit in a non-interactive shell: it makes the
shell exit after executing the EXIT trap, if any. If this is used inside
the EXIT trap, the shell will exit immediately.
In an interactive shell, this will abort the currently executed command and resume prompting for a next command line.
Exit(Option<ExitStatus>)
Exit from the current shell execution environment.
This makes the shell exit after executing the EXIT trap, if any. If this is used inside the EXIT trap, the shell will exit immediately.
Abort(Option<ExitStatus>)
Exit from the current shell execution environment immediately.
This makes the shell exit without executing the EXIT trap.
Implementations§
Source§impl Divert
impl Divert
Sourcepub fn exit_status(&self) -> Option<ExitStatus>
pub fn exit_status(&self) -> Option<ExitStatus>
Returns the exit status associated with the Divert.
Returns the variant’s value if self is Exit or Interrupt;
otherwise, None.
Trait Implementations§
Source§impl Ord for Divert
impl Ord for Divert
Source§impl PartialOrd for Divert
impl PartialOrd for Divert
impl Copy for Divert
impl Eq for Divert
impl StructuralPartialEq for Divert
Auto Trait Implementations§
impl Freeze for Divert
impl RefUnwindSafe for Divert
impl Send for Divert
impl Sync for Divert
impl Unpin for Divert
impl UnwindSafe for Divert
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
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>
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>
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