[][src]Enum lark_entity::EntityData

pub enum EntityData {
    Error(ErrorReported),
    LangItem(LangItem),
    InputFile {
        file: FileName,
    },
    ItemName {
        base: Entity,
        kind: ItemKind,
        id: GlobalIdentifier,
    },
    MemberName {
        base: Entity,
        kind: MemberKind,
        id: GlobalIdentifier,
    },
}

Variants

Error(ErrorReported)

Indicates that fetching the entity somehow failed with an error (which has been separately reported).

LangItem(LangItem)InputFile

Fields of InputFile

file: FileName
ItemName

Fields of ItemName

base: Entitykind: ItemKindid: GlobalIdentifier
MemberName

Fields of MemberName

base: Entitykind: MemberKindid: GlobalIdentifier

Methods

impl EntityData[src]

pub fn parent(&self) -> Option<Entity>[src]

Returns the parent entity, if any. This will be Some for items, members, etc.

pub fn file_name(&self, db: &dyn AsRef<EntityTables>) -> Option<FileName>[src]

Returns the file in which this entity is located (if any). This is none for lang items, errors.

pub fn relative_name(
    self,
    db: &impl AsRef<GlobalIdentifierTables>
) -> String
[src]

Gives a little information about the name/kind of this entity, without dumping the whole tree. Meant for debugging.

pub fn is_value(&self) -> bool[src]

True if this entity represents a value that the user could store into a variable (or might, in the case of error entities).

pub fn has_fn_body(&self) -> bool[src]

True if this entity has a fn body associated with it.

Trait Implementations

impl Eq for EntityData[src]

impl Clone for EntityData[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<EntityData> for EntityData[src]

impl Hash for EntityData[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for EntityData[src]

impl DebugWith for EntityData[src]

fn debug_with<Cx>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, &'me Self, Cx> where
    Cx: ?Sized
[src]

fn into_debug_with<Cx>(self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> where
    Cx: ?Sized
[src]

impl Intern<EntityTables> for EntityData

type Key = Entity

impl InternDirect<EntityTables> for EntityData

Auto Trait Implementations

impl Send for EntityData

impl Sync for EntityData

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T