Enum cssparser::parser::ParseUntilErrorBehavior
source · pub enum ParseUntilErrorBehavior {
Consume,
Stop,
}
Expand description
When parsing until a given token, sometimes the caller knows that parsing is going to restart at some earlier point, and consuming until we find a top level delimiter is just wasted work.
In that case, callers can pass ParseUntilErrorBehavior::Stop to avoid doing all that wasted work.
This is important for things like CSS nesting, where something like:
foo:is(..) { … }
Would need to scan the whole {} block to find a semicolon, only for parsing getting restarted as a qualified rule later.
Variants§
Trait Implementations§
source§impl Clone for ParseUntilErrorBehavior
impl Clone for ParseUntilErrorBehavior
source§fn clone(&self) -> ParseUntilErrorBehavior
fn clone(&self) -> ParseUntilErrorBehavior
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 moresource§impl Debug for ParseUntilErrorBehavior
impl Debug for ParseUntilErrorBehavior
source§impl PartialEq for ParseUntilErrorBehavior
impl PartialEq for ParseUntilErrorBehavior
source§fn eq(&self, other: &ParseUntilErrorBehavior) -> bool
fn eq(&self, other: &ParseUntilErrorBehavior) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ParseUntilErrorBehavior
impl Eq for ParseUntilErrorBehavior
impl StructuralPartialEq for ParseUntilErrorBehavior
Auto Trait Implementations§
impl Freeze for ParseUntilErrorBehavior
impl RefUnwindSafe for ParseUntilErrorBehavior
impl Send for ParseUntilErrorBehavior
impl Sync for ParseUntilErrorBehavior
impl Unpin for ParseUntilErrorBehavior
impl UnwindSafe for ParseUntilErrorBehavior
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