#[non_exhaustive]pub enum Condition {
Exit,
Signal(Number),
}Expand description
Condition under which an Action is executed
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Exit
When the shell exits
Signal(Number)
When the specified signal is delivered to the shell process
Implementations§
Source§impl Condition
impl Condition
Sourcepub fn to_string<S: SignalSystem>(&self, system: &S) -> Cow<'static, str>
pub fn to_string<S: SignalSystem>(&self, system: &S) -> Cow<'static, str>
Converts this Condition to a String.
The result is an uppercase string representing the condition such as
"EXIT" and "TERM". Signal names are obtained from
signal::Name::as_string. This function depends on the signal system
to convert signal numbers to names.
Sourcepub fn iter<S: SignalSystem>(system: &S) -> impl Iterator<Item = Condition> + '_
pub fn iter<S: SignalSystem>(system: &S) -> impl Iterator<Item = Condition> + '_
Returns an iterator over all possible conditions.
The iterator yields all the conditions supported by the given signal
system. The first condition is Condition::Exit, followed by all the
signals in the ascending order of their signal numbers.
Trait Implementations§
Source§impl From<i32> for Condition
Conversion from raw signal number to Condition
impl From<i32> for Condition
Conversion from raw signal number to Condition
If the number is zero, the result is Condition::Exit. Otherwise, the
result is Condition::Signal with the signal number.
Source§impl Ord for Condition
impl Ord for Condition
Source§impl PartialOrd for Condition
impl PartialOrd for Condition
impl Copy for Condition
impl Eq for Condition
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
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