Struct uu_env::string_parser::StringParser
source · pub struct StringParser<'a> { /* private fields */ }
Expand description
This class makes parsing a OsString char by char more convenient.
It also allows to capturing of intermediate positions for later splitting.
Implementations§
source§impl<'a> StringParser<'a>
impl<'a> StringParser<'a>
pub fn new(input: &'a NativeIntStr) -> Self
pub fn new_at(input: &'a NativeIntStr, pos: usize) -> Self
pub fn get_input(&self) -> &'a NativeIntStr
pub fn get_peek_position(&self) -> usize
pub fn peek(&self) -> Result<char, Error>
pub fn peek_char_at_pointer(&self, at_pointer: usize) -> Result<char, Error>
pub fn peek_chunk(&self) -> Option<Chunk<'a>>
pub fn consume_chunk(&mut self) -> Result<Chunk<'a>, Error>
pub fn consume_one_ascii_or_all_non_ascii( &mut self, ) -> Result<Vec<Chunk<'a>>, Error>
pub fn skip_multiple(&mut self, skip_byte_count: usize)
pub fn skip_until_char_or_end(&mut self, c: char)
pub fn substring(&self, range: &Range<usize>) -> &'a NativeIntStr
pub fn peek_remaining(&self) -> Cow<'a, OsStr>
pub fn set_pointer(&mut self, new_pointer: usize)
Auto Trait Implementations§
impl<'a> Freeze for StringParser<'a>
impl<'a> RefUnwindSafe for StringParser<'a>
impl<'a> Send for StringParser<'a>
impl<'a> Sync for StringParser<'a>
impl<'a> Unpin for StringParser<'a>
impl<'a> UnwindSafe for StringParser<'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