Skip to main content

EnumRef

Type Alias EnumRef 

Source
pub type EnumRef<'a> = MaybeImported<&'a Enum, &'a ImportedEnum>;
Expand description

A reference to an enum in the document’s scope.

Aliased Type§

pub enum EnumRef<'a> {
    Local(&'a Enum),
    Imported(&'a ImportedEnum),
}

Variants§

§

Local(&'a Enum)

The item is locally defined.

§

Imported(&'a ImportedEnum)

The item was imported from another document.

Implementations§

Source§

impl<'a> EnumRef<'a>

Source

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

Gets the name of the enum.

Source

pub fn name_span(&self) -> Span

Gets the span of the name.

Source

pub fn ty(&self) -> Option<&'a Type>

Gets the type of the enum, if it was computed.

Source

pub fn source(&self) -> Option<Arc<Url>>

Gets the source of the enum if it was imported.

Source

pub fn definition(&self) -> EnumDefinition

Reconstructs the AST definition from the stored green node.

Source

pub fn offset(&self) -> usize

Gets the offset of the enum.

Source

pub fn node(&self) -> &'a GreenNode

Gets the node of the enum.