Struct cairo_lang_lowering::objects::blocks::Blocks
source · pub struct Blocks<T>(pub Vec<T>);
Expand description
A convenient wrapper around a vector of blocks. This is used instead of id_arena, since the latter is harder to clone and modify.
Tuple Fields§
§0: Vec<T>
Implementations§
source§impl<T: Default> Blocks<T>
impl<T: Default> Blocks<T>
pub fn new() -> Self
pub fn alloc(&mut self, block: T) -> BlockId
sourcepub fn alloc_empty(&mut self) -> BlockId
pub fn alloc_empty(&mut self) -> BlockId
Allocate a new block ID. The block itself should be populated later.
pub fn iter(&self) -> BlocksIter<'_, T> ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn root_block(&self) -> Maybe<&T>
pub fn has_root(&self) -> Maybe<()>
Trait Implementations§
source§impl<'a, T> IntoIterator for &'a Blocks<T>
impl<'a, T> IntoIterator for &'a Blocks<T>
source§impl<T: PartialEq> PartialEq<Blocks<T>> for Blocks<T>
impl<T: PartialEq> PartialEq<Blocks<T>> for Blocks<T>
impl<T: Eq> Eq for Blocks<T>
impl<T> StructuralEq for Blocks<T>
impl<T> StructuralPartialEq for Blocks<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Blocks<T>where T: RefUnwindSafe,
impl<T> Send for Blocks<T>where T: Send,
impl<T> Sync for Blocks<T>where T: Sync,
impl<T> Unpin for Blocks<T>where T: Unpin,
impl<T> UnwindSafe for Blocks<T>where T: UnwindSafe,
Blanket Implementations§
source§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.