#[non_exhaustive]pub enum WordPart {
Literal(SmolStr),
SingleQuoted(SmolStr),
DoubleQuoted(Vec<WordPart>),
Parameter(SmolStr),
CommandSubstitution(SmolStr),
Arithmetic(SmolStr),
ProcessSubstIn(SmolStr),
ProcessSubstOut(SmolStr),
}Expand description
A segment of a word — literals, quoted strings, expansions, etc.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Literal(SmolStr)
Unquoted literal text.
SingleQuoted(SmolStr)
Content inside single quotes.
DoubleQuoted(Vec<WordPart>)
Content inside double quotes (may contain nested expansions).
Parameter(SmolStr)
$name or ${...} parameter expansion. Stores the name or full
expansion text (e.g. "var" for $var, "var:-default" for ${var:-default}).
CommandSubstitution(SmolStr)
$(...) command substitution. Stores the inner source text (not yet parsed).
Arithmetic(SmolStr)
$((...)) arithmetic expansion. Stores the inner expression text.
ProcessSubstIn(SmolStr)
<(cmd) process substitution (input). Stores the inner command text.
ProcessSubstOut(SmolStr)
>(cmd) process substitution (output). Stores the inner command text.
Trait Implementations§
impl StructuralPartialEq for WordPart
Auto Trait Implementations§
impl Freeze for WordPart
impl RefUnwindSafe for WordPart
impl Send for WordPart
impl Sync for WordPart
impl Unpin for WordPart
impl UnsafeUnpin for WordPart
impl UnwindSafe for WordPart
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