pub enum WordUnit {
Unquoted(TextUnit),
SingleQuote(String),
DoubleQuote(Text),
DollarSingleQuote(EscapedString),
Tilde {
name: String,
followed_by_slash: bool,
},
}Expand description
Element of a Word, i.e., text with quotes and tilde expansion
Variants§
Unquoted(TextUnit)
Unquoted TextUnit as a word unit
SingleQuote(String)
String surrounded with a pair of single quotations
DoubleQuote(Text)
Text surrounded with a pair of double quotations
DollarSingleQuote(EscapedString)
String surrounded with a pair of single quotations and preceded by a dollar sign
Tilde
Tilde expansion
Trait Implementations§
Source§impl MaybeLiteral for WordUnit
impl MaybeLiteral for WordUnit
Source§fn extend_literal<T: Extend<char>>(
&self,
result: &mut T,
) -> Result<(), NotLiteral>
fn extend_literal<T: Extend<char>>( &self, result: &mut T, ) -> Result<(), NotLiteral>
If self is Unquoted(Literal(_)), appends the character to result.
Source§fn to_string_if_literal(&self) -> Option<String>
fn to_string_if_literal(&self) -> Option<String>
Checks if
self is literal and, if so, converts to a string.impl Eq for WordUnit
impl StructuralPartialEq for WordUnit
Auto Trait Implementations§
impl Freeze for WordUnit
impl !RefUnwindSafe for WordUnit
impl !Send for WordUnit
impl !Sync for WordUnit
impl Unpin for WordUnit
impl !UnwindSafe for WordUnit
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more