Enum conch_runtime::eval::Fields [−][src]
Represents the types of fields that may result from evaluating a word.
It is important to maintain such distinctions because evaluating parameters
such as $@ and $* have different behaviors in different contexts.
Variants
ZeroNo fields, distinct from present-but-null fields.
Single(T)A single field.
At(Vec<T>)Any number of fields resulting from evaluating the $@ special parameter.
Star(Vec<T>)Any number of fields resulting from evaluating the $* special parameter.
Split(Vec<T>)A non-zero number of fields resulting from splitting, and which do not have any special meaning.
Methods
impl<T: StringWrapper> Fields<T>[src]
impl<T: StringWrapper> Fields<T>pub fn is_null(&self) -> bool[src]
pub fn is_null(&self) -> boolIndicates if a set of fields is considered null.
A set of fields is null if every single string it holds is the empty string.
pub fn join(self) -> T[src]
pub fn join(self) -> TJoins all fields using a space.
Note: Zero is treated as a empty-but-present field for simplicity.
pub fn join_with_ifs<E: ?Sized>(self, env: &E) -> T where
E: VariableEnvironment,
E::VarName: Borrow<String>,
E::Var: Borrow<String>, [src]
pub fn join_with_ifs<E: ?Sized>(self, env: &E) -> T where
E: VariableEnvironment,
E::VarName: Borrow<String>,
E::Var: Borrow<String>, Joins any field unconditionally with the first character of $IFS.
If $IFS is unset, fields are joined with a space, or concatenated
if $IFS is empty.
Note: Zero is treated as a empty-but-present field for simplicity.
pub fn split<E: ?Sized>(self, env: &E) -> Fields<T> where
E: VariableEnvironment,
E::VarName: Borrow<String>,
E::Var: Borrow<String>, [src]
pub fn split<E: ?Sized>(self, env: &E) -> Fields<T> where
E: VariableEnvironment,
E::VarName: Borrow<String>,
E::Var: Borrow<String>, Splits a vector of fields further based on the contents of the IFS
variable (i.e. as long as it is non-empty). Any empty fields, original
or otherwise created will be discarded.
Trait Implementations
impl<T: PartialEq> PartialEq for Fields<T>[src]
impl<T: PartialEq> PartialEq for Fields<T>fn eq(&self, other: &Fields<T>) -> bool[src]
fn eq(&self, other: &Fields<T>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Fields<T>) -> bool[src]
fn ne(&self, other: &Fields<T>) -> boolThis method tests for !=.
impl<T: Eq> Eq for Fields<T>[src]
impl<T: Eq> Eq for Fields<T>impl<T: Clone> Clone for Fields<T>[src]
impl<T: Clone> Clone for Fields<T>fn clone(&self) -> Fields<T>[src]
fn clone(&self) -> Fields<T>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T: Debug> Debug for Fields<T>[src]
impl<T: Debug> Debug for Fields<T>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T> From<Vec<T>> for Fields<T>[src]
impl<T> From<Vec<T>> for Fields<T>impl<T> From<T> for Fields<T>[src]
impl<T> From<T> for Fields<T>impl<T> IntoIterator for Fields<T>[src]
impl<T> IntoIterator for Fields<T>