pub struct LexedWord<'a> { /* private fields */ }Expand description
Source-backed representation of a shell word produced by the lexer.
Implementations§
Source§impl<'a> LexedWord<'a>
impl<'a> LexedWord<'a>
Sourcepub fn segments(&self) -> impl Iterator<Item = &LexedWordSegment<'a>>
pub fn segments(&self) -> impl Iterator<Item = &LexedWordSegment<'a>>
Iterate over the segments that make up this word.
Sourcepub fn text(&self) -> Option<&str>
pub fn text(&self) -> Option<&str>
Return the word text when it is represented by a single segment.
Sourcepub fn joined_text(&self) -> String
pub fn joined_text(&self) -> String
Join all segments into an owned string.
Sourcepub fn single_segment(&self) -> Option<&LexedWordSegment<'a>>
pub fn single_segment(&self) -> Option<&LexedWordSegment<'a>>
Return the only segment when this word is not segmented.
Trait Implementations§
impl<'a> Eq for LexedWord<'a>
impl<'a> StructuralPartialEq for LexedWord<'a>
Auto Trait Implementations§
impl<'a> Freeze for LexedWord<'a>
impl<'a> RefUnwindSafe for LexedWord<'a>
impl<'a> Send for LexedWord<'a>
impl<'a> Sync for LexedWord<'a>
impl<'a> Unpin for LexedWord<'a>
impl<'a> UnsafeUnpin for LexedWord<'a>
impl<'a> UnwindSafe for LexedWord<'a>
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