pub type EnumWalker<'db> = Walker<'db, EnumId>;
Expand description

An enum declaration in the schema.

Aliased Type§

struct EnumWalker<'db> {
    pub db: &'db ParserDatabase,
    pub id: EnumId,
}

Fields§

§db: &'db ParserDatabase

The parser database being traversed.

§id: EnumId

The identifier of the focused element.

Implementations§

source§

impl<'db> EnumWalker<'db>

source

pub fn name(self) -> &'db str

The name of the enum.

source

pub fn ast_enum(self) -> &'db Enum

The AST node.

source

pub fn database_name(self) -> &'db str

The database name of the enum.

source

pub fn mapped_name(self) -> Option<&'db str>

The mapped name of the enum:

enum Colour {
    RED
    GREEN
    BLUE

    @@map("Color")
          ^^^^^^^
}
source

pub fn values(self) -> impl ExactSizeIterator<Item = EnumValueWalker<'db>>

The values of the enum.

source

pub fn indentation(self) -> IndentationType

How fields are indented in the enum.

source

pub fn newline(self) -> NewlineType

What kind of newlines the enum uses.

source

pub fn schema(self) -> Option<(&'db str, Span)>

The name of the schema the enum belongs to.

@@schema("public")
         ^^^^^^^^