pub enum Token<'a> {
Show 25 variants
Ident(Cow<'a, str>),
Function(Cow<'a, str>),
AtKeyword(Cow<'a, str>),
Hash {
value: Cow<'a, str>,
id: bool,
},
String(Cow<'a, str>),
BadString,
Url(Cow<'a, str>),
BadUrl,
Delim(char),
Number(Number<'a>),
Percentage(Number<'a>),
Dimension {
number: Number<'a>,
unit: Cow<'a, str>,
},
UnicodeRange {
start: u32,
end: u32,
},
Whitespace,
Cdo,
Cdc,
Colon,
Semicolon,
Comma,
LeftBracket,
RightBracket,
LeftParen,
RightParen,
LeftBrace,
RightBrace,
}Expand description
A CSS token. The ones that open a block or a function never reach a
parser’s output; they turn into ComponentValues.
Variants§
Ident(Cow<'a, str>)
Function(Cow<'a, str>)
name(, with the name.
AtKeyword(Cow<'a, str>)
@name, with the name.
Hash
#name. id is the type flag: set when the name would also be an
identifier, which an ID selector needs.
String(Cow<'a, str>)
BadString
Url(Cow<'a, str>)
An unquoted url(…), with what’s between the parentheses.
BadUrl
Delim(char)
Number(Number<'a>)
Percentage(Number<'a>)
Dimension
UnicodeRange
U+0-7F, made only where a unicode-range descriptor’s value is
tokenized; everywhere else that text is an ident and numbers.
Whitespace
Cdo
Cdc
Colon
Semicolon
Comma
LeftBracket
RightBracket
LeftParen
RightParen
LeftBrace
RightBrace
Trait Implementations§
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Forget for Token<'a>
impl<'a> Freeze for Token<'a>
impl<'a> Move for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnsafeUnpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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