Skip to main content

Keyword

Enum Keyword 

Source
pub enum Keyword {
Show 54 variants As(As), Async(Async), Auto(Auto), Await(Await), Become(Become), Box(Box), Break(Break), Const(Const), Continue(Continue), Crate(Crate), Default(Default), Do(Do), Dyn(Dyn), Else(Else), Enum(Enum), Extern(Extern), Final(Final), Fn(Fn), For(For), If(If), Impl(Impl), In(In), Let(Let), Loop(Loop), Macro(Macro), MacroRules(MacroRules), Match(Match), Mod(Mod), Move(Move), Mut(Mut), Override(Override), Priv(Priv), Pub(Pub), Raw(Raw), Ref(Ref), Return(Return), Safe(Safe), SelfType(SelfType), SelfValue(SelfValue), Static(Static), Struct(Struct), Super(Super), Trait(Trait), Try(Try), Type(Type), Typeof(Typeof), Union(Union), Unsafe(Unsafe), Unsized(Unsized), Use(Use), Virtual(Virtual), Where(Where), While(While), Yield(Yield),
}
Expand description

A Rust keyword token.

Variants§

§

As(As)

§

Async(Async)

§

Auto(Auto)

§

Await(Await)

§

Become(Become)

§

Box(Box)

§

Break(Break)

§

Const(Const)

§

Continue(Continue)

§

Crate(Crate)

§

Default(Default)

§

Do(Do)

§

Dyn(Dyn)

§

Else(Else)

§

Enum(Enum)

§

Extern(Extern)

§

Final(Final)

§

Fn(Fn)

§

For(For)

§

If(If)

§

Impl(Impl)

§

In(In)

§

Let(Let)

§

Loop(Loop)

§

Macro(Macro)

§

MacroRules(MacroRules)

§

Match(Match)

§

Mod(Mod)

§

Move(Move)

§

Mut(Mut)

§

Override(Override)

§

Priv(Priv)

§

Pub(Pub)

§

Raw(Raw)

§

Ref(Ref)

§

Return(Return)

§

Safe(Safe)

§

SelfType(SelfType)

§

SelfValue(SelfValue)

§

Static(Static)

§

Struct(Struct)

§

Super(Super)

§

Trait(Trait)

§

Try(Try)

§

Type(Type)

§

Typeof(Typeof)

§

Union(Union)

§

Unsafe(Unsafe)

§

Unsized(Unsized)

§

Use(Use)

§

Virtual(Virtual)

§

Where(Where)

§

While(While)

§

Yield(Yield)

Implementations§

Source§

impl Keyword

Source

pub fn as_str(&self) -> &'static str

Source

pub fn span(&self) -> Span

Source

pub fn set_span(&mut self, span: Span)

Source

pub fn from_str(text: &str, span: Span) -> Option<Self>

Source

pub fn to_token_tree(&self) -> TokenTree

Source

pub fn into_token_tree(self) -> TokenTree

Trait Implementations§

Source§

impl Clone for Keyword

Source§

fn clone(&self) -> Self

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 Copy for Keyword

Source§

impl Debug for Keyword

Source§

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

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

impl Display for Keyword

Source§

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

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

impl Eq for Keyword

Source§

impl From<As> for Keyword

Source§

fn from(value: As) -> Self

Converts to this type from the input type.
Source§

impl From<Async> for Keyword

Source§

fn from(value: Async) -> Self

Converts to this type from the input type.
Source§

impl From<Auto> for Keyword

Source§

fn from(value: Auto) -> Self

Converts to this type from the input type.
Source§

impl From<Await> for Keyword

Source§

fn from(value: Await) -> Self

Converts to this type from the input type.
Source§

impl From<Become> for Keyword

Source§

fn from(value: Become) -> Self

Converts to this type from the input type.
Source§

impl From<Box> for Keyword

Source§

fn from(value: Box) -> Self

Converts to this type from the input type.
Source§

impl From<Break> for Keyword

Source§

fn from(value: Break) -> Self

Converts to this type from the input type.
Source§

impl From<Const> for Keyword

Source§

fn from(value: Const) -> Self

Converts to this type from the input type.
Source§

impl From<Continue> for Keyword

Source§

fn from(value: Continue) -> Self

Converts to this type from the input type.
Source§

impl From<Crate> for Keyword

Source§

fn from(value: Crate) -> Self

Converts to this type from the input type.
Source§

impl From<Default> for Keyword

Source§

fn from(value: Default) -> Self

Converts to this type from the input type.
Source§

impl From<Do> for Keyword

Source§

fn from(value: Do) -> Self

Converts to this type from the input type.
Source§

impl From<Dyn> for Keyword

Source§

fn from(value: Dyn) -> Self

Converts to this type from the input type.
Source§

impl From<Else> for Keyword

Source§

fn from(value: Else) -> Self

Converts to this type from the input type.
Source§

impl From<Enum> for Keyword

Source§

fn from(value: Enum) -> Self

Converts to this type from the input type.
Source§

impl From<Extern> for Keyword

Source§

fn from(value: Extern) -> Self

Converts to this type from the input type.
Source§

impl From<Final> for Keyword

Source§

fn from(value: Final) -> Self

Converts to this type from the input type.
Source§

impl From<Fn> for Keyword

Source§

fn from(value: Fn) -> Self

Converts to this type from the input type.
Source§

impl From<For> for Keyword

Source§

fn from(value: For) -> Self

Converts to this type from the input type.
Source§

impl From<If> for Keyword

Source§

fn from(value: If) -> Self

Converts to this type from the input type.
Source§

impl From<Impl> for Keyword

Source§

fn from(value: Impl) -> Self

Converts to this type from the input type.
Source§

impl From<In> for Keyword

Source§

fn from(value: In) -> Self

Converts to this type from the input type.
Source§

impl From<Keyword> for TokenTree

Source§

fn from(value: Keyword) -> Self

Converts to this type from the input type.
Source§

impl From<Let> for Keyword

Source§

fn from(value: Let) -> Self

Converts to this type from the input type.
Source§

impl From<Loop> for Keyword

Source§

fn from(value: Loop) -> Self

Converts to this type from the input type.
Source§

impl From<Macro> for Keyword

Source§

fn from(value: Macro) -> Self

Converts to this type from the input type.
Source§

impl From<MacroRules> for Keyword

Source§

fn from(value: MacroRules) -> Self

Converts to this type from the input type.
Source§

impl From<Match> for Keyword

Source§

fn from(value: Match) -> Self

Converts to this type from the input type.
Source§

impl From<Mod> for Keyword

Source§

fn from(value: Mod) -> Self

Converts to this type from the input type.
Source§

impl From<Move> for Keyword

Source§

fn from(value: Move) -> Self

Converts to this type from the input type.
Source§

impl From<Mut> for Keyword

Source§

fn from(value: Mut) -> Self

Converts to this type from the input type.
Source§

impl From<Override> for Keyword

Source§

fn from(value: Override) -> Self

Converts to this type from the input type.
Source§

impl From<Priv> for Keyword

Source§

fn from(value: Priv) -> Self

Converts to this type from the input type.
Source§

impl From<Pub> for Keyword

Source§

fn from(value: Pub) -> Self

Converts to this type from the input type.
Source§

impl From<Raw> for Keyword

Source§

fn from(value: Raw) -> Self

Converts to this type from the input type.
Source§

impl From<Ref> for Keyword

Source§

fn from(value: Ref) -> Self

Converts to this type from the input type.
Source§

impl From<Return> for Keyword

Source§

fn from(value: Return) -> Self

Converts to this type from the input type.
Source§

impl From<Safe> for Keyword

Source§

fn from(value: Safe) -> Self

Converts to this type from the input type.
Source§

impl From<SelfType> for Keyword

Source§

fn from(value: SelfType) -> Self

Converts to this type from the input type.
Source§

impl From<SelfValue> for Keyword

Source§

fn from(value: SelfValue) -> Self

Converts to this type from the input type.
Source§

impl From<Static> for Keyword

Source§

fn from(value: Static) -> Self

Converts to this type from the input type.
Source§

impl From<Struct> for Keyword

Source§

fn from(value: Struct) -> Self

Converts to this type from the input type.
Source§

impl From<Super> for Keyword

Source§

fn from(value: Super) -> Self

Converts to this type from the input type.
Source§

impl From<Trait> for Keyword

Source§

fn from(value: Trait) -> Self

Converts to this type from the input type.
Source§

impl From<Try> for Keyword

Source§

fn from(value: Try) -> Self

Converts to this type from the input type.
Source§

impl From<Type> for Keyword

Source§

fn from(value: Type) -> Self

Converts to this type from the input type.
Source§

impl From<Typeof> for Keyword

Source§

fn from(value: Typeof) -> Self

Converts to this type from the input type.
Source§

impl From<Union> for Keyword

Source§

fn from(value: Union) -> Self

Converts to this type from the input type.
Source§

impl From<Unsafe> for Keyword

Source§

fn from(value: Unsafe) -> Self

Converts to this type from the input type.
Source§

impl From<Unsized> for Keyword

Source§

fn from(value: Unsized) -> Self

Converts to this type from the input type.
Source§

impl From<Use> for Keyword

Source§

fn from(value: Use) -> Self

Converts to this type from the input type.
Source§

impl From<Virtual> for Keyword

Source§

fn from(value: Virtual) -> Self

Converts to this type from the input type.
Source§

impl From<Where> for Keyword

Source§

fn from(value: Where) -> Self

Converts to this type from the input type.
Source§

impl From<While> for Keyword

Source§

fn from(value: While) -> Self

Converts to this type from the input type.
Source§

impl From<Yield> for Keyword

Source§

fn from(value: Yield) -> Self

Converts to this type from the input type.
Source§

impl Hash for Keyword

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Keyword

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Scan for Keyword

Source§

fn scan(cursor: Cursor<'_>) -> Result<(Cursor<'_>, Self), LexError>

Source§

impl Spanner for Keyword

Source§

fn span(&self) -> Span

Source§

impl StructuralPartialEq for Keyword

Source§

impl ToTokens for Keyword

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Auto Trait Implementations§

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<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<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<X> ToTokenStream for X
where X: ToTokens + ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.