pub enum Token {
LeftBracket,
RightBracket,
Uint(usize),
Dot,
Uid(Uid),
Colon,
DoubleSlash,
BracketTypename(String),
Ident(Ident),
Error(String),
Eof,
}Expand description
An identifier token.
Variants§
LeftBracket
“[”
RightBracket
“]”
Uint(usize)
A decimal unsigned integer, can appear in brackets
Dot
“.”
Uid(Uid)
“-uid” suffixes, FLICKR58 format
Colon
“:”, can appear in brackets
DoubleSlash
“//”
BracketTypename(String)
Typename, within a bracket. These are rust identifiers, plus ‘:’ characters.
Ident(Ident)
An identifier, following rust rules.
Error(String)
Special token to denote a lexer error. It contains the unlexed remainder of the input. The error occured on the first character.
Eof
No more tokens.
Implementations§
Source§impl Token
impl Token
Sourcepub fn into_left_bracket(self) -> Result<(), ParseError>
pub fn into_left_bracket(self) -> Result<(), ParseError>
Return the token as a left bracket, otherwise a parse error.
Sourcepub fn into_right_bracket(self) -> Result<(), ParseError>
pub fn into_right_bracket(self) -> Result<(), ParseError>
Return the token as a right bracket, otherwise a parse error.
Sourcepub fn into_uint(self) -> Result<usize, ParseError>
pub fn into_uint(self) -> Result<usize, ParseError>
Return the token as a uint, otherwise a parse error.
Sourcepub fn into_dot(self) -> Result<(), ParseError>
pub fn into_dot(self) -> Result<(), ParseError>
Return the token as a dot, otherwise a parse error.
Sourcepub fn into_uid(self) -> Result<Uid, ParseError>
pub fn into_uid(self) -> Result<Uid, ParseError>
Return the token as a Uid, otherwise a parse error.
Sourcepub fn into_colon(self) -> Result<(), ParseError>
pub fn into_colon(self) -> Result<(), ParseError>
Return the token as a colon, otherwise a parse error.
Sourcepub fn into_double_slash(self) -> Result<(), ParseError>
pub fn into_double_slash(self) -> Result<(), ParseError>
Return the token as a double slash, otherwise a parse error.
Sourcepub fn into_bracket_typename(self) -> Result<String, ParseError>
pub fn into_bracket_typename(self) -> Result<String, ParseError>
Return the token as a bracket typename, otherwise a parse error.
Sourcepub fn into_ident(self) -> Result<Ident, ParseError>
pub fn into_ident(self) -> Result<Ident, ParseError>
Return the token as an ident, otherwise a parse error.
Sourcepub fn into_error(self) -> Result<String, ParseError>
pub fn into_error(self) -> Result<String, ParseError>
Return the token as an error, otherwise a parse error.
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more