pub enum MetaItem<'a> {
None,
Set(BTreeSet<MetaItemRef<'a>>),
Source {
file: MetaStringRef<'a>,
start: SourcePosition,
end: SourcePosition,
},
NamedScope {
name: MetaStringRef<'a>,
source: MetaItemRef<'a>,
parent: MetaItemRef<'a>,
},
IndexedScope {
index: i32,
source: MetaItemRef<'a>,
parent: MetaItemRef<'a>,
},
Ident {
name: MetaStringRef<'a>,
scope: MetaItemRef<'a>,
},
Attr {
name: MetaStringRef<'a>,
value: ParamValue,
},
}
Expand description
Metadata item.
Metadata items represent information about cells that does not affect computational semantics. Some metadata items only carry information about the source code, and other metadata items affect how the netlist is transformed.
Variants§
None
Absence of a metadata item. The purpose of this variant is to make metadata indices take less memory.
Set(BTreeSet<MetaItemRef<'a>>)
Multiple metadata items. The purpose of this variant is to make collections of metadata indices take less memory. A metadata set cannot contain less than two metadata items.
Source
Source location.
Fields
file: MetaStringRef<'a>
Filename. Must not be empty.
start: SourcePosition
Start of the range (inclusive).
end: SourcePosition
End of the range (exclusive).
NamedScope
Scope identified by a name. A top-level named scope could be a module declaration. A named scope with a parent could be a block within a module.
Fields
name: MetaStringRef<'a>
Name. Must not be empty.
source: MetaItemRef<'a>
Source location. Must reference MetaItem::None
or MetaItem::Source
.
parent: MetaItemRef<'a>
Parent scope. Must reference MetaItem::None
, MetaItem::NamedScope
, or MetaItem::IndexedScope
.
IndexedScope
Scope identified by an index. A top-level named scope could be a module declaration. A named scope with a parent could be a named instance of a module within another module.
Fields
source: MetaItemRef<'a>
Source location. Must reference MetaItem::None
or MetaItem::Source
.
parent: MetaItemRef<'a>
Parent scope. Must reference MetaItem::None
, MetaItem::NamedScope
, or MetaItem::IndexedScope
.
Ident
Identifier within source code.
Fields
name: MetaStringRef<'a>
Name. Must not be empty.
scope: MetaItemRef<'a>
Containing scope.
Must reference a MetaItem::NamedScope
, or MetaItem::IndexedScope
.
Attr
Implementations§
Trait Implementations§
Source§impl<'a> Ord for MetaItem<'a>
impl<'a> Ord for MetaItem<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialOrd for MetaItem<'a>
impl<'a> PartialOrd for MetaItem<'a>
impl<'a> Eq for MetaItem<'a>
impl<'a> StructuralPartialEq for MetaItem<'a>
Auto Trait Implementations§
impl<'a> Freeze for MetaItem<'a>
impl<'a> !RefUnwindSafe for MetaItem<'a>
impl<'a> !Send for MetaItem<'a>
impl<'a> !Sync for MetaItem<'a>
impl<'a> Unpin for MetaItem<'a>
impl<'a> !UnwindSafe for MetaItem<'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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.