pub enum BashCondition {
Show 14 variants
FileExists(BashExpr),
IsFile(BashExpr),
IsDir(BashExpr),
NonEmpty(BashExpr),
Empty(BashExpr),
StrEq(BashExpr, BashExpr),
StrNe(BashExpr, BashExpr),
StrLt(BashExpr, BashExpr),
ArithLt(String, String),
ArithEq(String, String),
And(Box<BashCondition>, Box<BashCondition>),
Or(Box<BashCondition>, Box<BashCondition>),
Not(Box<BashCondition>),
Raw(String),
}Expand description
A Bash [[ ... ]] conditional test.
Variants§
FileExists(BashExpr)
[[ -e file ]]
IsFile(BashExpr)
[[ -f file ]]
IsDir(BashExpr)
[[ -d file ]]
NonEmpty(BashExpr)
[[ -n str ]]
Empty(BashExpr)
[[ -z str ]]
StrEq(BashExpr, BashExpr)
[[ a == b ]]
StrNe(BashExpr, BashExpr)
[[ a != b ]]
StrLt(BashExpr, BashExpr)
[[ a < b ]] (lexicographic)
ArithLt(String, String)
(( a < b ))
ArithEq(String, String)
(( a == b ))
And(Box<BashCondition>, Box<BashCondition>)
[[ cond1 && cond2 ]]
Or(Box<BashCondition>, Box<BashCondition>)
[[ cond1 || cond2 ]]
Not(Box<BashCondition>)
! cond
Raw(String)
Raw condition string (fallback)
Trait Implementations§
Source§impl Clone for BashCondition
impl Clone for BashCondition
Source§fn clone(&self) -> BashCondition
fn clone(&self) -> BashCondition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BashCondition
impl Debug for BashCondition
Source§impl Display for BashCondition
impl Display for BashCondition
Source§impl PartialEq for BashCondition
impl PartialEq for BashCondition
impl StructuralPartialEq for BashCondition
Auto Trait Implementations§
impl Freeze for BashCondition
impl RefUnwindSafe for BashCondition
impl Send for BashCondition
impl Sync for BashCondition
impl Unpin for BashCondition
impl UnsafeUnpin for BashCondition
impl UnwindSafe for BashCondition
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