[][src]Trait lark_parser::syntax::entity::LazyParsedEntity

pub trait LazyParsedEntity {
    fn parse_children(
        &self,
        entity: Entity,
        db: &dyn LazyParsedEntityDatabase
    ) -> WithError<Seq<ParsedEntity>>;
fn parse_generic_declarations(
        &self,
        entity: Entity,
        db: &dyn LazyParsedEntityDatabase
    ) -> WithError<Result<Arc<GenericDeclarations>, ErrorReported>>;
fn parse_type(
        &self,
        entity: Entity,
        db: &dyn LazyParsedEntityDatabase
    ) -> WithError<Ty<Declaration>>;
fn parse_signature(
        &self,
        entity: Entity,
        db: &dyn LazyParsedEntityDatabase
    ) -> WithError<Result<Signature<Declaration>, ErrorReported>>;
fn parse_fn_body(
        &self,
        entity: Entity,
        db: &dyn LazyParsedEntityDatabase
    ) -> WithError<FnBody>; }

Required methods

fn parse_children(
    &self,
    entity: Entity,
    db: &dyn LazyParsedEntityDatabase
) -> WithError<Seq<ParsedEntity>>

Parse the children of this entity.

Parameters

  • entity: the entity id of self
  • db: the necessary bits/pieces of the parser database

fn parse_generic_declarations(
    &self,
    entity: Entity,
    db: &dyn LazyParsedEntityDatabase
) -> WithError<Result<Arc<GenericDeclarations>, ErrorReported>>

What "generic declarations" are on this entity? e.g., for struct Foo<T> { .. }, this would return the declaration for T.

fn parse_type(
    &self,
    entity: Entity,
    db: &dyn LazyParsedEntityDatabase
) -> WithError<Ty<Declaration>>

What is the "declared type" of this entity? If the entity has generic types, this type will include bound types referring to those generics. e.g., for struct Foo<T> { .. }, the result would be effectively Foo<T>.

fn parse_signature(
    &self,
    entity: Entity,
    db: &dyn LazyParsedEntityDatabase
) -> WithError<Result<Signature<Declaration>, ErrorReported>>

What is the "signature" of this entity?

fn parse_fn_body(
    &self,
    entity: Entity,
    db: &dyn LazyParsedEntityDatabase
) -> WithError<FnBody>

Parses the fn body associated with this entity, panicking if there is none.

Parameters

  • entity: the entity id of self
  • db: the necessary bits/pieces of the parser database
Loading content...

Implementors

impl LazyParsedEntity for ParsedFile[src]

impl LazyParsedEntity for ParsedField[src]

impl LazyParsedEntity for ParsedMethod[src]

Loading content...