Enum yash_syntax::syntax::WordUnit
source · [−]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.
Tilde(String)
Tilde expansion.
The String
value does not contain the initial tilde.
Trait Implementations
sourceimpl MaybeLiteral for WordUnit
impl MaybeLiteral for WordUnit
sourcefn extend_if_literal<T: Extend<char>>(&self, result: T) -> Result<T, T>
fn extend_if_literal<T: Extend<char>>(&self, result: T) -> Result<T, T>
If self
is Unquoted(Literal(_))
, appends the character to result
and returns Ok(result)
. Otherwise, returns Err(result)
.
sourcefn 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 StructuralEq for WordUnit
impl StructuralPartialEq for WordUnit
Auto Trait Implementations
impl !RefUnwindSafe for WordUnit
impl !Send for WordUnit
impl !Sync for WordUnit
impl Unpin for WordUnit
impl !UnwindSafe for WordUnit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more