Trait sway_ast::keywords::Keyword

source ·
pub trait Keyword: Spanned + Sized {
    const AS_STR: &'static str;

    // Required methods
    fn new(span: Span) -> Self;
    fn ident(&self) -> Ident;
}
Expand description

The type is a keyword.

Required Associated Constants§

source

const AS_STR: &'static str

What the string representation of the keyword is when lexing.

Required Methods§

source

fn new(span: Span) -> Self

Creates the keyword from the given span.

source

fn ident(&self) -> Ident

Returns an identifier for this keyword.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Keyword for AbiToken

source§

const AS_STR: &'static str = "abi"

source§

impl Keyword for AsToken

source§

const AS_STR: &'static str = "as"

source§

impl Keyword for AsmToken

source§

const AS_STR: &'static str = "asm"

source§

impl Keyword for BreakToken

source§

const AS_STR: &'static str = "break"

source§

impl Keyword for ClassToken

source§

const AS_STR: &'static str = "class"

source§

impl Keyword for ConfigurableToken

source§

const AS_STR: &'static str = "configurable"

source§

impl Keyword for ConstToken

source§

const AS_STR: &'static str = "const"

source§

impl Keyword for ContinueToken

source§

const AS_STR: &'static str = "continue"

source§

impl Keyword for ContractToken

source§

const AS_STR: &'static str = "contract"

source§

impl Keyword for ElseToken

source§

const AS_STR: &'static str = "else"

source§

impl Keyword for EnumToken

source§

const AS_STR: &'static str = "enum"

source§

impl Keyword for FalseToken

source§

const AS_STR: &'static str = "false"

source§

impl Keyword for FnToken

source§

const AS_STR: &'static str = "fn"

source§

impl Keyword for ForToken

source§

const AS_STR: &'static str = "for"

source§

impl Keyword for IfToken

source§

const AS_STR: &'static str = "if"

source§

impl Keyword for ImplToken

source§

const AS_STR: &'static str = "impl"

source§

impl Keyword for InToken

source§

const AS_STR: &'static str = "in"

source§

impl Keyword for LetToken

source§

const AS_STR: &'static str = "let"

source§

impl Keyword for LibraryToken

source§

const AS_STR: &'static str = "library"

source§

impl Keyword for MatchToken

source§

const AS_STR: &'static str = "match"

source§

impl Keyword for ModToken

source§

const AS_STR: &'static str = "mod"

source§

impl Keyword for MutToken

source§

const AS_STR: &'static str = "mut"

source§

impl Keyword for PredicateToken

source§

const AS_STR: &'static str = "predicate"

source§

impl Keyword for PtrToken

source§

const AS_STR: &'static str = "__ptr"

source§

impl Keyword for PubToken

source§

const AS_STR: &'static str = "pub"

source§

impl Keyword for RefToken

source§

const AS_STR: &'static str = "ref"

source§

impl Keyword for ReturnToken

source§

const AS_STR: &'static str = "return"

source§

impl Keyword for ScriptToken

source§

const AS_STR: &'static str = "script"

source§

impl Keyword for SelfToken

source§

const AS_STR: &'static str = "self"

source§

impl Keyword for SliceToken

source§

const AS_STR: &'static str = "__slice"

source§

impl Keyword for StorageToken

source§

const AS_STR: &'static str = "storage"

source§

impl Keyword for StrToken

source§

const AS_STR: &'static str = "str"

source§

impl Keyword for StructToken

source§

const AS_STR: &'static str = "struct"

source§

impl Keyword for TraitToken

source§

const AS_STR: &'static str = "trait"

source§

impl Keyword for TrueToken

source§

const AS_STR: &'static str = "true"

source§

impl Keyword for TypeToken

source§

const AS_STR: &'static str = "type"

source§

impl Keyword for UseToken

source§

const AS_STR: &'static str = "use"

source§

impl Keyword for WhereToken

source§

const AS_STR: &'static str = "where"

source§

impl Keyword for WhileToken

source§

const AS_STR: &'static str = "while"