Struct calyx_frontend::Attributes
source · [−]pub struct Attributes { /* private fields */ }
Expand description
Attributes associated with a specific IR structure.
Implementations
sourceimpl Attributes
impl Attributes
sourcepub fn get<A>(&self, key: A) -> Option<u64>where
A: Into<Attribute>,
pub fn get<A>(&self, key: A) -> Option<u64>where
A: Into<Attribute>,
Get the value associated with an attribute key
sourcepub fn has<A>(&self, key: A) -> boolwhere
A: Into<Attribute>,
pub fn has<A>(&self, key: A) -> boolwhere
A: Into<Attribute>,
Check if an attribute key has been set
sourcepub fn remove<A>(&mut self, key: A)where
A: Into<Attribute>,
pub fn remove<A>(&mut self, key: A)where
A: Into<Attribute>,
Remove attribute with the name key
sourcepub fn copy_from<A>(&mut self, other: Self, keys: Vec<A>)where
A: Into<Attribute> + Clone,
pub fn copy_from<A>(&mut self, other: Self, keys: Vec<A>)where
A: Into<Attribute> + Clone,
self
copys (i.e., assigns the same values) the attributes in other
.
However, we only copy attributes in keys
(i.e.. we don’t copy
all attributes in other
, only the ones that we specify).
If a key
is not present in other
, then we ignore that key
.
Example: suppose
self: A->10, B->5
other: A->15, C->5
keys: A, D
Then self gets: A->15 B->5. (D is ignored since it’s not present in other
and C is ignored since it’s not keys.)
pub fn to_string_with<F>(&self, sep: &'static str, fmt: F) -> Stringwhere
F: Fn(String, u64) -> String,
Trait Implementations
sourceimpl Clone for Attributes
impl Clone for Attributes
sourcefn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Attributes
impl Debug for Attributes
sourceimpl Default for Attributes
impl Default for Attributes
sourcefn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
sourceimpl PartialEq<Attributes> for Attributes
impl PartialEq<Attributes> for Attributes
sourceimpl WithPos for Attributes
impl WithPos for Attributes
impl Eq for Attributes
Auto Trait Implementations
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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,
fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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,
fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.