pub enum ScriptConstruct {
Simple(String),
SetVar {
key: String,
val: String,
},
UnsetVar(String),
ForLoop {
var: String,
items: Vec<String>,
body: Vec<String>,
},
WhileLoop {
cond: String,
body: Vec<String>,
},
IfElse {
cond: String,
then_body: Vec<String>,
else_body: Vec<String>,
},
}Expand description
Script construct types recognized by the parser.
Variants§
Simple(String)
Simple command line (possibly with pipes).
SetVar
set VAR=VALUE
UnsetVar(String)
unset VAR
ForLoop
for VAR in ITEMS ; do BODY ; done
WhileLoop
while COND ; do BODY ; done
IfElse
if COND ; then THEN_BODY [; else ELSE_BODY] ; fi
Auto Trait Implementations§
impl Freeze for ScriptConstruct
impl RefUnwindSafe for ScriptConstruct
impl Send for ScriptConstruct
impl Sync for ScriptConstruct
impl Unpin for ScriptConstruct
impl UnsafeUnpin for ScriptConstruct
impl UnwindSafe for ScriptConstruct
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> 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