pub enum TextUnit {
Literal(char),
Backslashed(char),
RawParam {
param: Param,
location: Location,
},
BracedParam(BracedParam),
CommandSubst {
content: Rc<str>,
location: Location,
},
Backquote {
content: Vec<BackquoteUnit>,
location: Location,
},
Arith {
content: Text,
location: Location,
},
}
Expand description
Element of a Text, i.e., something that can be expanded
Variants§
Literal(char)
Literal single character
Backslashed(char)
Backslash-escaped single character
RawParam
Parameter expansion that is not enclosed in braces
Fields
BracedParam(BracedParam)
Parameter expansion that is enclosed in braces
CommandSubst
Command substitution of the form $(...)
Fields
Backquote
Command substitution of the form `...`
Fields
§
content: Vec<BackquoteUnit>
Command string that will be parsed and executed when the command substitution is expanded
Arith
Arithmetic expansion
Trait Implementations§
Source§impl MaybeLiteral for TextUnit
impl MaybeLiteral for TextUnit
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 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 TextUnit
impl StructuralPartialEq for TextUnit
Auto Trait Implementations§
impl Freeze for TextUnit
impl !RefUnwindSafe for TextUnit
impl !Send for TextUnit
impl !Sync for TextUnit
impl Unpin for TextUnit
impl !UnwindSafe for TextUnit
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