pub struct Word {
pub parts: Vec<WordPart>,
}Expand description
One argv word built from concatenated parts.
Fields§
§parts: Vec<WordPart>Parts in source order.
Implementations§
Source§impl Word
impl Word
Sourcepub fn as_literal(&self) -> Option<&str>
pub fn as_literal(&self) -> Option<&str>
Returns the word’s text when it is a single unquoted literal.
Sourcepub fn is_bare_command_substitution(&self) -> bool
pub fn is_bare_command_substitution(&self) -> bool
Reports whether the whole word is exactly one command substitution.
x=$(cmd) preserves the command’s structured value instead of coercing it to text. This is
a deliberate, documented deviation from bash, where $() is always textual; it is what lets
ip=$(curl ...) be followed by echo ${ip[origin]}.
Trait Implementations§
impl Eq for Word
impl StructuralPartialEq for Word
Auto Trait Implementations§
impl Freeze for Word
impl RefUnwindSafe for Word
impl Send for Word
impl Sync for Word
impl Unpin for Word
impl UnsafeUnpin for Word
impl UnwindSafe for Word
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.