Skip to main content

Token

Enum Token 

Source
pub enum Token<'s> {
Show 60 variants Eof(Eof), Ampersand(Ampersand), Asterisk(Asterisk), AsteriskEqual(AsteriskEqual), At(At), AtKeyword(AtKeyword<'s>), AtLBraceVar(AtLBraceVar<'s>), BacktickCode(BacktickCode<'s>), Bar(Bar), BarBar(BarBar), BarEqual(BarEqual), CaretEqual(CaretEqual), Cdc(Cdc), Cdo(Cdo), Colon(Colon), ColonColon(ColonColon), Comma(Comma), Dedent(Dedent), Dimension(Dimension<'s>), DollarEqual(DollarEqual), DollarLBraceVar(DollarLBraceVar<'s>), DollarVar(DollarVar<'s>), Dot(Dot), DotDotDot(DotDotDot), Equal(Equal), EqualEqual(EqualEqual), Exclamation(Exclamation), ExclamationEqual(ExclamationEqual), GreaterThan(GreaterThan), GreaterThanEqual(GreaterThanEqual), Hash(Hash<'s>), HashLBrace(HashLBrace), Ident(Ident<'s>), Indent(Indent), LBrace(LBrace), LBracket(LBracket), LessThan(LessThan), LessThanEqual(LessThanEqual), Linebreak(Linebreak), LParen(LParen), Minus(Minus), Number(Number<'s>), NumberSign(NumberSign), Percent(Percent), Percentage(Percentage<'s>), Placeholder(Placeholder<'s>), Plus(Plus), PlusUnderscore(PlusUnderscore), Question(Question), RBrace(RBrace), RBracket(RBracket), RParen(RParen), Semicolon(Semicolon), Solidus(Solidus), Str(Str<'s>), StrTemplate(StrTemplate<'s>), Tilde(Tilde), TildeEqual(TildeEqual), UrlRaw(UrlRaw<'s>), UrlTemplate(UrlTemplate<'s>),
}

Variants§

§

Eof(Eof)

§

Ampersand(Ampersand)

§

Asterisk(Asterisk)

§

AsteriskEqual(AsteriskEqual)

§

At(At)

§

AtKeyword(AtKeyword<'s>)

§

AtLBraceVar(AtLBraceVar<'s>)

§

BacktickCode(BacktickCode<'s>)

§

Bar(Bar)

§

BarBar(BarBar)

§

BarEqual(BarEqual)

§

CaretEqual(CaretEqual)

§

Cdc(Cdc)

§

Cdo(Cdo)

§

Colon(Colon)

§

ColonColon(ColonColon)

§

Comma(Comma)

§

Dedent(Dedent)

§

Dimension(Dimension<'s>)

§

DollarEqual(DollarEqual)

§

DollarLBraceVar(DollarLBraceVar<'s>)

§

DollarVar(DollarVar<'s>)

§

Dot(Dot)

§

DotDotDot(DotDotDot)

§

Equal(Equal)

§

EqualEqual(EqualEqual)

§

Exclamation(Exclamation)

§

ExclamationEqual(ExclamationEqual)

§

GreaterThan(GreaterThan)

§

GreaterThanEqual(GreaterThanEqual)

§

Hash(Hash<'s>)

§

HashLBrace(HashLBrace)

§

Ident(Ident<'s>)

§

Indent(Indent)

§

LBrace(LBrace)

§

LBracket(LBracket)

§

LessThan(LessThan)

§

LessThanEqual(LessThanEqual)

§

Linebreak(Linebreak)

§

LParen(LParen)

§

Minus(Minus)

§

Number(Number<'s>)

§

NumberSign(NumberSign)

§

Percent(Percent)

§

Percentage(Percentage<'s>)

§

Placeholder(Placeholder<'s>)

§

Plus(Plus)

§

PlusUnderscore(PlusUnderscore)

§

Question(Question)

§

RBrace(RBrace)

§

RBracket(RBracket)

§

RParen(RParen)

§

Semicolon(Semicolon)

§

Solidus(Solidus)

§

Str(Str<'s>)

§

StrTemplate(StrTemplate<'s>)

§

Tilde(Tilde)

§

TildeEqual(TildeEqual)

§

UrlRaw(UrlRaw<'s>)

§

UrlTemplate(UrlTemplate<'s>)

Implementations§

§

impl<'s> Token<'s>

pub fn is_eof(&self) -> bool

Checks whether this is Eof.

pub fn as_eof(&self) -> Option<&Eof>

Returns Some with a reference to Eof, otherwise None.

pub fn is_ampersand(&self) -> bool

Checks whether this is Ampersand.

pub fn as_ampersand(&self) -> Option<&Ampersand>

Returns Some with a reference to Ampersand, otherwise None.

pub fn is_asterisk(&self) -> bool

Checks whether this is Asterisk.

pub fn as_asterisk(&self) -> Option<&Asterisk>

Returns Some with a reference to Asterisk, otherwise None.

pub fn is_asterisk_equal(&self) -> bool

Checks whether this is AsteriskEqual.

pub fn as_asterisk_equal(&self) -> Option<&AsteriskEqual>

Returns Some with a reference to AsteriskEqual, otherwise None.

pub fn is_at(&self) -> bool

Checks whether this is At.

pub fn as_at(&self) -> Option<&At>

Returns Some with a reference to At, otherwise None.

pub fn is_at_keyword(&self) -> bool

Checks whether this is AtKeyword.

pub fn as_at_keyword(&self) -> Option<&AtKeyword<'s>>

Returns Some with a reference to AtKeyword, otherwise None.

pub fn is_at_l_brace_var(&self) -> bool

Checks whether this is AtLBraceVar.

pub fn as_at_l_brace_var(&self) -> Option<&AtLBraceVar<'s>>

Returns Some with a reference to AtLBraceVar, otherwise None.

pub fn is_backtick_code(&self) -> bool

Checks whether this is BacktickCode.

pub fn as_backtick_code(&self) -> Option<&BacktickCode<'s>>

Returns Some with a reference to BacktickCode, otherwise None.

pub fn is_bar(&self) -> bool

Checks whether this is Bar.

pub fn as_bar(&self) -> Option<&Bar>

Returns Some with a reference to Bar, otherwise None.

pub fn is_bar_bar(&self) -> bool

Checks whether this is BarBar.

pub fn as_bar_bar(&self) -> Option<&BarBar>

Returns Some with a reference to BarBar, otherwise None.

pub fn is_bar_equal(&self) -> bool

Checks whether this is BarEqual.

pub fn as_bar_equal(&self) -> Option<&BarEqual>

Returns Some with a reference to BarEqual, otherwise None.

pub fn is_caret_equal(&self) -> bool

Checks whether this is CaretEqual.

pub fn as_caret_equal(&self) -> Option<&CaretEqual>

Returns Some with a reference to CaretEqual, otherwise None.

pub fn is_cdc(&self) -> bool

Checks whether this is Cdc.

pub fn as_cdc(&self) -> Option<&Cdc>

Returns Some with a reference to Cdc, otherwise None.

pub fn is_cdo(&self) -> bool

Checks whether this is Cdo.

pub fn as_cdo(&self) -> Option<&Cdo>

Returns Some with a reference to Cdo, otherwise None.

pub fn is_colon(&self) -> bool

Checks whether this is Colon.

pub fn as_colon(&self) -> Option<&Colon>

Returns Some with a reference to Colon, otherwise None.

pub fn is_colon_colon(&self) -> bool

Checks whether this is ColonColon.

pub fn as_colon_colon(&self) -> Option<&ColonColon>

Returns Some with a reference to ColonColon, otherwise None.

pub fn is_comma(&self) -> bool

Checks whether this is Comma.

pub fn as_comma(&self) -> Option<&Comma>

Returns Some with a reference to Comma, otherwise None.

pub fn is_dedent(&self) -> bool

Checks whether this is Dedent.

pub fn as_dedent(&self) -> Option<&Dedent>

Returns Some with a reference to Dedent, otherwise None.

pub fn is_dimension(&self) -> bool

Checks whether this is Dimension.

pub fn as_dimension(&self) -> Option<&Dimension<'s>>

Returns Some with a reference to Dimension, otherwise None.

pub fn is_dollar_equal(&self) -> bool

Checks whether this is DollarEqual.

pub fn as_dollar_equal(&self) -> Option<&DollarEqual>

Returns Some with a reference to DollarEqual, otherwise None.

pub fn is_dollar_l_brace_var(&self) -> bool

Checks whether this is DollarLBraceVar.

pub fn as_dollar_l_brace_var(&self) -> Option<&DollarLBraceVar<'s>>

Returns Some with a reference to DollarLBraceVar, otherwise None.

pub fn is_dollar_var(&self) -> bool

Checks whether this is DollarVar.

pub fn as_dollar_var(&self) -> Option<&DollarVar<'s>>

Returns Some with a reference to DollarVar, otherwise None.

pub fn is_dot(&self) -> bool

Checks whether this is Dot.

pub fn as_dot(&self) -> Option<&Dot>

Returns Some with a reference to Dot, otherwise None.

pub fn is_dot_dot_dot(&self) -> bool

Checks whether this is DotDotDot.

pub fn as_dot_dot_dot(&self) -> Option<&DotDotDot>

Returns Some with a reference to DotDotDot, otherwise None.

pub fn is_equal(&self) -> bool

Checks whether this is Equal.

pub fn as_equal(&self) -> Option<&Equal>

Returns Some with a reference to Equal, otherwise None.

pub fn is_equal_equal(&self) -> bool

Checks whether this is EqualEqual.

pub fn as_equal_equal(&self) -> Option<&EqualEqual>

Returns Some with a reference to EqualEqual, otherwise None.

pub fn is_exclamation(&self) -> bool

Checks whether this is Exclamation.

pub fn as_exclamation(&self) -> Option<&Exclamation>

Returns Some with a reference to Exclamation, otherwise None.

pub fn is_exclamation_equal(&self) -> bool

Checks whether this is ExclamationEqual.

pub fn as_exclamation_equal(&self) -> Option<&ExclamationEqual>

Returns Some with a reference to ExclamationEqual, otherwise None.

pub fn is_greater_than(&self) -> bool

Checks whether this is GreaterThan.

pub fn as_greater_than(&self) -> Option<&GreaterThan>

Returns Some with a reference to GreaterThan, otherwise None.

pub fn is_greater_than_equal(&self) -> bool

Checks whether this is GreaterThanEqual.

pub fn as_greater_than_equal(&self) -> Option<&GreaterThanEqual>

Returns Some with a reference to GreaterThanEqual, otherwise None.

pub fn is_hash(&self) -> bool

Checks whether this is Hash.

pub fn as_hash(&self) -> Option<&Hash<'s>>

Returns Some with a reference to Hash, otherwise None.

pub fn is_hash_l_brace(&self) -> bool

Checks whether this is HashLBrace.

pub fn as_hash_l_brace(&self) -> Option<&HashLBrace>

Returns Some with a reference to HashLBrace, otherwise None.

pub fn is_ident(&self) -> bool

Checks whether this is Ident.

pub fn as_ident(&self) -> Option<&Ident<'s>>

Returns Some with a reference to Ident, otherwise None.

pub fn is_indent(&self) -> bool

Checks whether this is Indent.

pub fn as_indent(&self) -> Option<&Indent>

Returns Some with a reference to Indent, otherwise None.

pub fn is_l_brace(&self) -> bool

Checks whether this is LBrace.

pub fn as_l_brace(&self) -> Option<&LBrace>

Returns Some with a reference to LBrace, otherwise None.

pub fn is_l_bracket(&self) -> bool

Checks whether this is LBracket.

pub fn as_l_bracket(&self) -> Option<&LBracket>

Returns Some with a reference to LBracket, otherwise None.

pub fn is_less_than(&self) -> bool

Checks whether this is LessThan.

pub fn as_less_than(&self) -> Option<&LessThan>

Returns Some with a reference to LessThan, otherwise None.

pub fn is_less_than_equal(&self) -> bool

Checks whether this is LessThanEqual.

pub fn as_less_than_equal(&self) -> Option<&LessThanEqual>

Returns Some with a reference to LessThanEqual, otherwise None.

pub fn is_linebreak(&self) -> bool

Checks whether this is Linebreak.

pub fn as_linebreak(&self) -> Option<&Linebreak>

Returns Some with a reference to Linebreak, otherwise None.

pub fn is_l_paren(&self) -> bool

Checks whether this is LParen.

pub fn as_l_paren(&self) -> Option<&LParen>

Returns Some with a reference to LParen, otherwise None.

pub fn is_minus(&self) -> bool

Checks whether this is Minus.

pub fn as_minus(&self) -> Option<&Minus>

Returns Some with a reference to Minus, otherwise None.

pub fn is_number(&self) -> bool

Checks whether this is Number.

pub fn as_number(&self) -> Option<&Number<'s>>

Returns Some with a reference to Number, otherwise None.

pub fn is_number_sign(&self) -> bool

Checks whether this is NumberSign.

pub fn as_number_sign(&self) -> Option<&NumberSign>

Returns Some with a reference to NumberSign, otherwise None.

pub fn is_percent(&self) -> bool

Checks whether this is Percent.

pub fn as_percent(&self) -> Option<&Percent>

Returns Some with a reference to Percent, otherwise None.

pub fn is_percentage(&self) -> bool

Checks whether this is Percentage.

pub fn as_percentage(&self) -> Option<&Percentage<'s>>

Returns Some with a reference to Percentage, otherwise None.

pub fn is_placeholder(&self) -> bool

Checks whether this is Placeholder.

pub fn as_placeholder(&self) -> Option<&Placeholder<'s>>

Returns Some with a reference to Placeholder, otherwise None.

pub fn is_plus(&self) -> bool

Checks whether this is Plus.

pub fn as_plus(&self) -> Option<&Plus>

Returns Some with a reference to Plus, otherwise None.

pub fn is_plus_underscore(&self) -> bool

Checks whether this is PlusUnderscore.

pub fn as_plus_underscore(&self) -> Option<&PlusUnderscore>

Returns Some with a reference to PlusUnderscore, otherwise None.

pub fn is_question(&self) -> bool

Checks whether this is Question.

pub fn as_question(&self) -> Option<&Question>

Returns Some with a reference to Question, otherwise None.

pub fn is_r_brace(&self) -> bool

Checks whether this is RBrace.

pub fn as_r_brace(&self) -> Option<&RBrace>

Returns Some with a reference to RBrace, otherwise None.

pub fn is_r_bracket(&self) -> bool

Checks whether this is RBracket.

pub fn as_r_bracket(&self) -> Option<&RBracket>

Returns Some with a reference to RBracket, otherwise None.

pub fn is_r_paren(&self) -> bool

Checks whether this is RParen.

pub fn as_r_paren(&self) -> Option<&RParen>

Returns Some with a reference to RParen, otherwise None.

pub fn is_semicolon(&self) -> bool

Checks whether this is Semicolon.

pub fn as_semicolon(&self) -> Option<&Semicolon>

Returns Some with a reference to Semicolon, otherwise None.

pub fn is_solidus(&self) -> bool

Checks whether this is Solidus.

pub fn as_solidus(&self) -> Option<&Solidus>

Returns Some with a reference to Solidus, otherwise None.

pub fn is_str(&self) -> bool

Checks whether this is Str.

pub fn as_str(&self) -> Option<&Str<'s>>

Returns Some with a reference to Str, otherwise None.

pub fn is_str_template(&self) -> bool

Checks whether this is StrTemplate.

pub fn as_str_template(&self) -> Option<&StrTemplate<'s>>

Returns Some with a reference to StrTemplate, otherwise None.

pub fn is_tilde(&self) -> bool

Checks whether this is Tilde.

pub fn as_tilde(&self) -> Option<&Tilde>

Returns Some with a reference to Tilde, otherwise None.

pub fn is_tilde_equal(&self) -> bool

Checks whether this is TildeEqual.

pub fn as_tilde_equal(&self) -> Option<&TildeEqual>

Returns Some with a reference to TildeEqual, otherwise None.

pub fn is_url_raw(&self) -> bool

Checks whether this is UrlRaw.

pub fn as_url_raw(&self) -> Option<&UrlRaw<'s>>

Returns Some with a reference to UrlRaw, otherwise None.

pub fn is_url_template(&self) -> bool

Checks whether this is UrlTemplate.

pub fn as_url_template(&self) -> Option<&UrlTemplate<'s>>

Returns Some with a reference to UrlTemplate, otherwise None.

Trait Implementations§

Source§

impl<'s> Clone for Token<'s>

Source§

fn clone(&self) -> Token<'s>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'s> Debug for Token<'s>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'s> PartialEq for Token<'s>

Source§

fn eq(&self, other: &Token<'s>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'s> StructuralPartialEq for Token<'s>

Auto Trait Implementations§

§

impl<'s> Freeze for Token<'s>

§

impl<'s> RefUnwindSafe for Token<'s>

§

impl<'s> Send for Token<'s>

§

impl<'s> Sync for Token<'s>

§

impl<'s> Unpin for Token<'s>

§

impl<'s> UnsafeUnpin for Token<'s>

§

impl<'s> UnwindSafe for Token<'s>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.