Struct cairo_lang_lowering::objects::blocks::BlocksBuilder
source · pub struct BlocksBuilder<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> BlocksBuilder<T>
impl<T: Default> BlocksBuilder<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 len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn build(self) -> Option<Blocks<T>>
Trait Implementations§
source§impl<T: Clone> Clone for BlocksBuilder<T>
impl<T: Clone> Clone for BlocksBuilder<T>
source§fn clone(&self) -> BlocksBuilder<T>
fn clone(&self) -> BlocksBuilder<T>
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<T: Debug> Debug for BlocksBuilder<T>
impl<T: Debug> Debug for BlocksBuilder<T>
source§impl<T: Default> Default for BlocksBuilder<T>
impl<T: Default> Default for BlocksBuilder<T>
source§fn default() -> BlocksBuilder<T>
fn default() -> BlocksBuilder<T>
Returns the “default value” for a type. Read more
source§impl<T: PartialEq> PartialEq for BlocksBuilder<T>
impl<T: PartialEq> PartialEq for BlocksBuilder<T>
source§fn eq(&self, other: &BlocksBuilder<T>) -> bool
fn eq(&self, other: &BlocksBuilder<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq> Eq for BlocksBuilder<T>
impl<T> StructuralEq for BlocksBuilder<T>
impl<T> StructuralPartialEq for BlocksBuilder<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for BlocksBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for BlocksBuilder<T>where
T: Send,
impl<T> Sync for BlocksBuilder<T>where
T: Sync,
impl<T> Unpin for BlocksBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for BlocksBuilder<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.