pub struct StreamCharPos<P>where
P: UserPosn,{ /* private fields */ }
Expand description
This provides the byte offset of a character within a stream, with an associated position that might also accurately provide line and column numbers of the position
This can be used as a PosnInCharStream implementation for a lexer; if crate::LineColumn is used for the generic argument then the lexer will correctly track the line and column of the position of tokens.
Implementations§
Trait Implementations§
Source§impl<P> Clone for StreamCharPos<P>
impl<P> Clone for StreamCharPos<P>
Source§fn clone(&self) -> StreamCharPos<P>
fn clone(&self) -> StreamCharPos<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P> Debug for StreamCharPos<P>
impl<P> Debug for StreamCharPos<P>
Source§impl<P> Default for StreamCharPos<P>
impl<P> Default for StreamCharPos<P>
Source§fn default() -> StreamCharPos<P>
fn default() -> StreamCharPos<P>
Returns the “default value” for a type. Read more
Source§impl<P> Display for StreamCharPos<P>where
P: UserPosn,
impl<P> Display for StreamCharPos<P>where
P: UserPosn,
Source§impl<P> Hash for StreamCharPos<P>
impl<P> Hash for StreamCharPos<P>
Source§impl<P> PartialEq for StreamCharPos<P>
impl<P> PartialEq for StreamCharPos<P>
Source§impl<P> PosnInCharStream for StreamCharPos<P>where
P: UserPosn,
impl<P> PosnInCharStream for StreamCharPos<P>where
P: UserPosn,
Source§impl<P> UserPosn for StreamCharPos<P>where
P: UserPosn,
impl<P> UserPosn for StreamCharPos<P>where
P: UserPosn,
Source§fn advance_cols(self, num_bytes: usize, num_chars: usize) -> Self
fn advance_cols(self, num_bytes: usize, num_chars: usize) -> Self
Advance the state of the stream by a number of bytes and a
number of characters; the characters are guaranteed to not
be newlines Read more
Source§fn advance_line(self, num_bytes: usize) -> Self
fn advance_line(self, num_bytes: usize) -> Self
Advance the state of the stream by a number of bytes and to
the start of the next line Read more
impl<P> Copy for StreamCharPos<P>
impl<P> Eq for StreamCharPos<P>
impl<P> StructuralPartialEq for StreamCharPos<P>where
P: UserPosn,
Auto Trait Implementations§
impl<P> Freeze for StreamCharPos<P>where
P: Freeze,
impl<P> RefUnwindSafe for StreamCharPos<P>where
P: RefUnwindSafe,
impl<P> Send for StreamCharPos<P>where
P: Send,
impl<P> Sync for StreamCharPos<P>where
P: Sync,
impl<P> Unpin for StreamCharPos<P>where
P: Unpin,
impl<P> UnwindSafe for StreamCharPos<P>where
P: 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