Struct cssparser::TokenSerializationType
source · [−]pub struct TokenSerializationType(_);
Expand description
A category of token. See the needs_separator_when_before
method.
Implementations
sourceimpl TokenSerializationType
impl TokenSerializationType
sourcepub fn nothing() -> TokenSerializationType
pub fn nothing() -> TokenSerializationType
Return a value that represents the absence of a token, e.g. before the start of the input.
sourcepub fn set_if_nothing(&mut self, new_value: TokenSerializationType)
pub fn set_if_nothing(&mut self, new_value: TokenSerializationType)
If this value is TokenSerializationType::nothing()
, set it to the given value instead.
sourcepub fn needs_separator_when_before(self, other: TokenSerializationType) -> bool
pub fn needs_separator_when_before(self, other: TokenSerializationType) -> bool
Return true if, when a token of category self
is serialized just before
a token of category other
with no whitespace in between,
an empty comment /**/
needs to be inserted between them
so that they are not re-parsed as a single token.
See https://drafts.csswg.org/css-syntax/#serialization
See https://github.com/w3c/csswg-drafts/issues/4088 for the
DelimPercent
bits.
Trait Implementations
sourceimpl Clone for TokenSerializationType
impl Clone for TokenSerializationType
sourcefn clone(&self) -> TokenSerializationType
fn clone(&self) -> TokenSerializationType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TokenSerializationType
impl Debug for TokenSerializationType
sourceimpl PartialEq<TokenSerializationType> for TokenSerializationType
impl PartialEq<TokenSerializationType> for TokenSerializationType
sourcefn eq(&self, other: &TokenSerializationType) -> bool
fn eq(&self, other: &TokenSerializationType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TokenSerializationType) -> bool
fn ne(&self, other: &TokenSerializationType) -> bool
This method tests for !=
.
impl Copy for TokenSerializationType
impl Eq for TokenSerializationType
impl StructuralEq for TokenSerializationType
impl StructuralPartialEq for TokenSerializationType
Auto Trait Implementations
impl RefUnwindSafe for TokenSerializationType
impl Send for TokenSerializationType
impl Sync for TokenSerializationType
impl Unpin for TokenSerializationType
impl UnwindSafe for TokenSerializationType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more