Enum conch_runtime::eval::Fields [] [src]

pub enum Fields<T> {
    Zero,
    Single(T),
    At(Vec<T>),
    Star(Vec<T>),
    Split(Vec<T>),
}

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

No fields, distinct from present-but-null fields.

A single field.

Any number of fields resulting from evaluating the $@ special parameter.

Any number of fields resulting from evaluating the $* special parameter.

A non-zero number of fields resulting from splitting, and which do not have any special meaning.

Methods

impl<T: StringWrapper> Fields<T>
[src]

[src]

Indicates if a set of fields is considered null.

A set of fields is null if every single string it holds is the empty string.

[src]

Joins all fields using a space.

Note: Zero is treated as a empty-but-present field for simplicity.

[src]

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.

[src]

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]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq> Eq for Fields<T>
[src]

impl<T: Clone> Clone for Fields<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Fields<T>
[src]

[src]

Formats the value using the given formatter.

impl<T> From<Vec<T>> for Fields<T>
[src]

[src]

Performs the conversion.

impl<T> From<T> for Fields<T>
[src]

[src]

Performs the conversion.

impl<T> IntoIterator for Fields<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more