Enum vhdl_lang::ast::Declaration
source · pub enum Declaration {
Show 13 variants
Object(ObjectDeclaration),
File(FileDeclaration),
Type(TypeDeclaration),
Component(ComponentDeclaration),
Attribute(Attribute),
Alias(AliasDeclaration),
SubprogramDeclaration(SubprogramDeclaration),
SubprogramInstantiation(SubprogramInstantiation),
SubprogramBody(SubprogramBody),
Use(UseClause),
Package(PackageInstantiation),
Configuration(ConfigurationSpecification),
View(ModeViewDeclaration),
}
Variants§
Object(ObjectDeclaration)
File(FileDeclaration)
Type(TypeDeclaration)
Component(ComponentDeclaration)
Attribute(Attribute)
Alias(AliasDeclaration)
SubprogramDeclaration(SubprogramDeclaration)
SubprogramInstantiation(SubprogramInstantiation)
SubprogramBody(SubprogramBody)
Use(UseClause)
Package(PackageInstantiation)
Configuration(ConfigurationSpecification)
View(ModeViewDeclaration)
Implementations§
source§impl Declaration
impl Declaration
pub fn declarations(&self) -> Vec<EntityId>
source§impl Declaration
impl Declaration
sourcepub fn is_allowed_in_context(&self, parent: &AnyEntKind<'_>) -> bool
pub fn is_allowed_in_context(&self, parent: &AnyEntKind<'_>) -> bool
Returns whether the declaration denoted by self
is allowed in the given context.
For example, within an architecture, only constants, signals and shared variables are allowed,
variables are not.
§Conforming example:
architecture arch of ent is
signal foo : bit;
begin
end arch;
§Non-Conforming example:
architecture arch of ent is
variable foo : bit;
begin
end arch;
The context is given by the parent element of the declaration.
Trait Implementations§
source§impl Clone for Declaration
impl Clone for Declaration
source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Declaration
impl Debug for Declaration
source§impl PartialEq for Declaration
impl PartialEq for Declaration
source§impl Search for Declaration
impl Search for Declaration
fn search( &self, ctx: &dyn TokenAccess, searcher: &mut impl Searcher, ) -> SearchResult
impl StructuralPartialEq for Declaration
Auto Trait Implementations§
impl !Freeze for Declaration
impl !RefUnwindSafe for Declaration
impl Send for Declaration
impl Sync for Declaration
impl Unpin for Declaration
impl !UnwindSafe for Declaration
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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