Struct cssparser::ParserState
source · pub struct ParserState {
pub(crate) position: usize,
pub(crate) current_line_start_position: usize,
pub(crate) current_line_number: u32,
pub(crate) at_start_of: Option<BlockType>,
}
Expand description
A capture of the internal state of a Parser
(including the position within the input),
obtained from the Parser::position
method.
Can be used with the Parser::reset
method to restore that state.
Should only be used with the Parser
instance it came from.
Fields§
§position: usize
§current_line_start_position: usize
§current_line_number: u32
§at_start_of: Option<BlockType>
Implementations§
source§impl ParserState
impl ParserState
sourcepub fn position(&self) -> SourcePosition
pub fn position(&self) -> SourcePosition
The position from the start of the input, counted in UTF-8 bytes.
sourcepub fn source_location(&self) -> SourceLocation
pub fn source_location(&self) -> SourceLocation
The line number and column number
Trait Implementations§
source§impl Clone for ParserState
impl Clone for ParserState
source§fn clone(&self) -> ParserState
fn clone(&self) -> ParserState
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for ParserState
impl RefUnwindSafe for ParserState
impl Send for ParserState
impl Sync for ParserState
impl Unpin for ParserState
impl UnwindSafe for ParserState
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)