pub struct HierName(pub Vec<CompactString>);
Expand description
Hierarchical name.
Unlike the NetlistDB’s tree-like structure, this one adopts a simple Vec.
Tuple Fields§
§0: Vec<CompactString>
Implementations§
Trait Implementations§
source§impl Hash for HierName
impl Hash for HierName
Hashing a HierName.
Our guarantee here is that
Hash(HierName[a/b/c]) :== Hash(c, b, a)
.
This is essential for different HierName implementations to agree with each other on hash values. Especially, to conform with NetlistDB’s implementation.
For example, we have a Vec
here in SPEF parser’s
HierName implementation, but we cannot use derived Hash
on it. – because hash of a Vec
is the same as a slice,
which not only prefixes the hash with a length parameter,
but also hashes it forward instead of backward.
Thus we implement it by ourselves.
source§impl<'i> IntoIterator for &'i HierName
impl<'i> IntoIterator for &'i HierName
§type Item = &'i CompactString
type Item = &'i CompactString
The type of the elements being iterated over.
§type IntoIter = Rev<Iter<'i, CompactString>>
type IntoIter = Rev<Iter<'i, CompactString>>
Which kind of iterator are we turning this into?
source§impl PartialEq<HierName> for HierName
impl PartialEq<HierName> for HierName
impl Eq for HierName
impl StructuralEq for HierName
impl StructuralPartialEq for HierName
Auto Trait Implementations§
impl RefUnwindSafe for HierName
impl Send for HierName
impl Sync for HierName
impl Unpin for HierName
impl UnwindSafe for HierName
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<I, C> CompactStringExt for Cwhere
I: AsRef<str>,
&'a C: for<'a> IntoIterator<Item = &'a I>,
impl<I, C> CompactStringExt for Cwhere I: AsRef<str>, &'a C: for<'a> IntoIterator<Item = &'a I>,
source§fn concat_compact(&self) -> CompactString
fn concat_compact(&self) -> CompactString
Concatenates all the items of a collection into a
CompactString
Read moresource§fn join_compact<S>(&self, seperator: S) -> CompactStringwhere
S: AsRef<str>,
fn join_compact<S>(&self, seperator: S) -> CompactStringwhere S: AsRef<str>,
Joins all the items of a collection, placing a seperator between them, forming a
CompactString
Read moresource§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.