Struct html5tokenizer::offset::PosTrackingReader
source · pub struct PosTrackingReader<R> { /* private fields */ }
Expand description
Wraps a Reader
so that it implements Position<usize>
.
Implementations§
source§impl<R> PosTrackingReader<R>
impl<R> PosTrackingReader<R>
sourcepub fn new<'a>(into_reader: impl IntoReader<'a, Reader = R>) -> Self
pub fn new<'a>(into_reader: impl IntoReader<'a, Reader = R>) -> Self
Wraps the given Reader
so that it implements Position<usize>
with the position starting from 0.
Trait Implementations§
source§impl<R> Position<usize> for PosTrackingReader<R>
impl<R> Position<usize> for PosTrackingReader<R>
source§impl<R: Reader> Reader for PosTrackingReader<R>
impl<R: Reader> Reader for PosTrackingReader<R>
source§fn read_char(&mut self) -> Result<Option<char>, Self::Error>
fn read_char(&mut self) -> Result<Option<char>, Self::Error>
Return a new character from the input stream. Read more
source§fn try_read_string(
&mut self,
s: &str,
case_sensitive: bool
) -> Result<bool, Self::Error>
fn try_read_string( &mut self, s: &str, case_sensitive: bool ) -> Result<bool, Self::Error>
Attempt to read an entire string at once, either case-insensitively or not. Read more
source§fn len_of_char_in_current_encoding(&self, c: char) -> usize
fn len_of_char_in_current_encoding(&self, c: char) -> usize
Returns the number of bytes that the given character takes up in the current character encoding.
Auto Trait Implementations§
impl<R> RefUnwindSafe for PosTrackingReader<R>where
R: RefUnwindSafe,
impl<R> Send for PosTrackingReader<R>where
R: Send,
impl<R> Sync for PosTrackingReader<R>where
R: Sync,
impl<R> Unpin for PosTrackingReader<R>where
R: Unpin,
impl<R> UnwindSafe for PosTrackingReader<R>where
R: 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
source§impl<'a, R> IntoReader<'a> for Rwhere
R: 'a + Reader,
impl<'a, R> IntoReader<'a> for Rwhere
R: 'a + Reader,
source§fn into_reader(self) -> <R as IntoReader<'a>>::Reader
fn into_reader(self) -> <R as IntoReader<'a>>::Reader
Convert self into some sort of reader.
source§impl<R> Position<NoopOffset> for Rwhere
R: Reader,
impl<R> Position<NoopOffset> for Rwhere
R: Reader,
source§fn position(&self) -> NoopOffset
fn position(&self) -> NoopOffset
Returns the byte index of the current position.