#[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
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.
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: Signals>(&self, system: &S) -> Cow<'static, str>
pub fn to_string<S: Signals>(&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
Signals::sig2str.
Sourcepub fn iter<S: Signals>(system: &S) -> impl Iterator<Item = Condition> + '_
pub fn iter<S: Signals>(system: &S) -> impl Iterator<Item = Condition> + '_
Returns an iterator over all possible conditions.
The iterator yields all the conditions supported by the given Signals
implementation.
The iteration starts with 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
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