Enum conch_parser::ast::builder::ParameterSubstitutionKind
[−]
[src]
pub enum ParameterSubstitutionKind<W, C> {
Command(CommandGroup<C>),
Len(DefaultParameter),
Arith(Option<DefaultArithmetic>),
Default(bool, DefaultParameter, Option<W>),
Assign(bool, DefaultParameter, Option<W>),
Error(bool, DefaultParameter, Option<W>),
Alternative(bool, DefaultParameter, Option<W>),
RemoveSmallestSuffix(DefaultParameter, Option<W>),
RemoveLargestSuffix(DefaultParameter, Option<W>),
RemoveSmallestPrefix(DefaultParameter, Option<W>),
RemoveLargestPrefix(DefaultParameter, Option<W>),
}Represents the type of parameter that was parsed
Variants
Command(CommandGroup<C>)Returns the standard output of running a command, e.g. $(cmd)
Len(DefaultParameter)Returns the length of the value of a parameter, e.g. ${#param}
Arith(Option<DefaultArithmetic>)Returns the resulting value of an arithmetic subsitution, e.g. $(( x++ ))
Default(bool, DefaultParameter, Option<W>)Use a provided value if the parameter is null or unset, e.g.
${param:-[word]}.
The boolean indicates the presence of a :, and that if the parameter has
a null value, that situation should be treated as if the parameter is unset.
Assign(bool, DefaultParameter, Option<W>)Assign a provided value to the parameter if it is null or unset,
e.g. ${param:=[word]}.
The boolean indicates the presence of a :, and that if the parameter has
a null value, that situation should be treated as if the parameter is unset.
Error(bool, DefaultParameter, Option<W>)If the parameter is null or unset, an error should result with the provided
message, e.g. ${param:?[word]}.
The boolean indicates the presence of a :, and that if the parameter has
a null value, that situation should be treated as if the parameter is unset.
Alternative(bool, DefaultParameter, Option<W>)If the parameter is NOT null or unset, a provided word will be used,
e.g. ${param:+[word]}.
The boolean indicates the presence of a :, and that if the parameter has
a null value, that situation should be treated as if the parameter is unset.
RemoveSmallestSuffix(DefaultParameter, Option<W>)Remove smallest suffix pattern, e.g. ${param%pattern}
RemoveLargestSuffix(DefaultParameter, Option<W>)Remove largest suffix pattern, e.g. ${param%%pattern}
RemoveSmallestPrefix(DefaultParameter, Option<W>)Remove smallest prefix pattern, e.g. ${param#pattern}
RemoveLargestPrefix(DefaultParameter, Option<W>)Remove largest prefix pattern, e.g. ${param##pattern}
Trait Implementations
impl<W: Debug, C: Debug> Debug for ParameterSubstitutionKind<W, C>[src]
impl<W: PartialEq, C: PartialEq> PartialEq for ParameterSubstitutionKind<W, C>[src]
fn eq(&self, __arg_0: &ParameterSubstitutionKind<W, C>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &ParameterSubstitutionKind<W, C>) -> bool
This method tests for !=.
impl<W: Eq, C: Eq> Eq for ParameterSubstitutionKind<W, C>[src]
impl<W: Clone, C: Clone> Clone for ParameterSubstitutionKind<W, C>[src]
fn clone(&self) -> ParameterSubstitutionKind<W, C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more