pub(crate) struct Stream<'a> {
text: &'a str,
pos: usize,
end: usize,
}
Fields§
§text: &'a str
§pos: usize
§end: usize
Implementations§
Source§impl<'a> Stream<'a>
impl<'a> Stream<'a>
pub fn new(text: &'a str) -> Self
pub fn pos(&self) -> usize
pub fn jump_to_end(&mut self)
pub fn at_end(&self) -> bool
pub fn curr_byte(&self) -> Result<u8, Error>
pub fn curr_byte_unchecked(&self) -> u8
pub fn next_byte(&self) -> Result<u8, Error>
pub fn advance(&mut self, n: usize)
pub fn consume_byte(&mut self, c: u8) -> Result<(), Error>
pub fn try_consume_byte(&mut self, c: u8)
pub fn consume_bytes<F>(&mut self, f: F) -> &'a str
pub fn skip_bytes<F>(&mut self, f: F)
fn chars(&self) -> Chars<'a>
pub fn slice_range(&self, start: usize, end: usize) -> &'a str
pub fn slice_back(&self, pos: usize) -> &'a str
pub fn slice_tail(&self) -> &'a str
pub fn skip_spaces(&mut self)
pub fn skip_spaces_and_comments(&mut self) -> Result<(), Error>
pub fn consume_ident(&mut self) -> Result<&'a str, Error>
pub fn consume_string(&mut self) -> Result<&'a str, Error>
pub fn skip_comment(&mut self) -> Result<(), Error>
fn skip_comment_impl(&mut self) -> Result<(), Error>
pub fn gen_text_pos(&self) -> TextPos
pub fn gen_text_pos_from(&self, pos: usize) -> TextPos
fn calc_curr_row(text: &str, end: usize) -> u32
fn calc_curr_col(text: &str, end: usize) -> u32
Trait Implementations§
impl<'a> Copy for Stream<'a>
impl<'a> StructuralPartialEq for Stream<'a>
Auto Trait Implementations§
impl<'a> Freeze for Stream<'a>
impl<'a> RefUnwindSafe for Stream<'a>
impl<'a> Send for Stream<'a>
impl<'a> Sync for Stream<'a>
impl<'a> Unpin for Stream<'a>
impl<'a> UnwindSafe for Stream<'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