pub struct TextStream<C> {
pub chars: Vec<C>,
pub pos: usize,
}Expand description
A decoded character stream with a cursor for sequential reading.
C is the character type produced by the TextProvider.
Fields§
§chars: Vec<C>All decoded characters.
pos: usizeCurrent read position.
Implementations§
Source§impl<C> TextStream<C>
impl<C> TextStream<C>
Sourcepub fn next(&mut self) -> Option<&C>
pub fn next(&mut self) -> Option<&C>
Returns the next character and advances the cursor, or None
if the stream is exhausted.
Sourcepub fn peek(&self) -> Option<&C>
pub fn peek(&self) -> Option<&C>
Returns the next character without advancing the cursor,
or None if the stream is exhausted.
Sourcepub fn skip(&mut self, n: usize)
pub fn skip(&mut self, n: usize)
Advances the cursor by n positions, clamped to the stream length.
Auto Trait Implementations§
impl<C> Freeze for TextStream<C>
impl<C> RefUnwindSafe for TextStream<C>where
C: RefUnwindSafe,
impl<C> Send for TextStream<C>where
C: Send,
impl<C> Sync for TextStream<C>where
C: Sync,
impl<C> Unpin for TextStream<C>where
C: Unpin,
impl<C> UnsafeUnpin for TextStream<C>
impl<C> UnwindSafe for TextStream<C>where
C: UnwindSafe,
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