sway_ast::keywords

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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"