pub struct AnyEnt<'a> {
pub id: EntityId,
pub parent: Option<EntRef<'a>>,
pub related: Related<'a>,
pub implicits: Vec<EntRef<'a>>,
pub designator: Designator,
pub kind: AnyEntKind<'a>,
pub decl_pos: Option<SrcPos>,
pub src_span: TokenSpan,
pub source: Option<Source>,
pub attrs: FnvHashMap<Symbol, (SrcPos, AttributeEnt<'a>)>,
}
Expand description
A named entity as defined in LRM 6.1.
Every declaration creates one or more named entities.
Fields§
§id: EntityId
A unique id of the entity. Entities with the same id will be the same.
parent: Option<EntRef<'a>>
§implicits: Vec<EntRef<'a>>
§designator: Designator
The name of the entity. This will be a Designator::Identifier for ‘common’ named entities (such as functions, architectures, e.t.c.)
kind: AnyEntKind<'a>
contains more information about this named entity
decl_pos: Option<SrcPos>
The location where the declaration was made. Builtin and implicit declaration will not have a source position.
src_span: TokenSpan
The whole textual span that this entity encompasses.
source: Option<Source>
Where this declaration was made. Builtin and implicit declaration will not have a source position.
attrs: FnvHashMap<Symbol, (SrcPos, AttributeEnt<'a>)>
Custom attributes on this entity
Implementations§
source§impl<'a> AnyEnt<'a>
impl<'a> AnyEnt<'a>
pub fn id(&self) -> EntityId
pub fn declaration(&'a self) -> EntRef<'a>
pub fn is_implicit(&self) -> bool
pub fn is_subprogram(&self) -> bool
pub fn is_subprogram_decl(&self) -> bool
pub fn is_uninst_subprogram_decl(&self) -> bool
pub fn is_uninst_subprogram_body(&self) -> bool
pub fn is_uninst_subprogram(&self) -> bool
pub fn is_protected_type(&self) -> bool
pub fn is_protected_type_body(&self) -> bool
pub fn is_declared_by(&self, other: EntRef<'_>) -> bool
pub fn is_implicit_of(&self, other: EntityId) -> bool
pub fn is_instance_of(&self, other: EntRef<'_>) -> bool
pub fn is_explicit(&self) -> bool
sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
A statement without a label
pub fn decl_pos(&self) -> Option<&SrcPos>
pub fn parent_in_same_source(&self) -> Option<EntRef<'a>>
pub fn library_name(&self) -> Option<&Symbol>
pub fn designator(&self) -> &Designator
pub fn path_name(&self) -> String
pub fn kind(&self) -> &AnyEntKind<'_>
pub fn error( &self, diagnostics: &mut dyn DiagnosticHandler, message: impl Into<String>, code: ErrorCode, )
pub fn is_overloaded(&self) -> bool
pub fn signature(&self) -> Option<&Signature<'_>>
pub fn as_actual(&self) -> EntRef<'_>
pub fn get_attribute(&self, name: &Symbol) -> Option<AttributeEnt<'a>>
sourcepub fn actual_kind(&self) -> &AnyEntKind<'_>
pub fn actual_kind(&self) -> &AnyEntKind<'_>
Strip aliases and return reference to actual entity kind
sourcepub fn is_alias_of(&self, other: EntRef<'_>) -> bool
pub fn is_alias_of(&self, other: EntRef<'_>) -> bool
Returns true if self is alias of other
pub fn describe(&self) -> String
Trait Implementations§
impl<'a> Eq for AnyEnt<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnyEnt<'a>
impl<'a> !RefUnwindSafe for AnyEnt<'a>
impl<'a> Send for AnyEnt<'a>
impl<'a> Sync for AnyEnt<'a>
impl<'a> Unpin for AnyEnt<'a>
impl<'a> !UnwindSafe for AnyEnt<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more