pub struct Block<'c> { /* private fields */ }
Expand description
A block.
Implementations§
source§impl<'c> Block<'c>
impl<'c> Block<'c>
sourcepub fn argument(&self, index: usize) -> Result<BlockArgument<'c, '_>, Error>
pub fn argument(&self, index: usize) -> Result<BlockArgument<'c, '_>, Error>
Returns an argument at a position.
sourcepub fn argument_count(&self) -> usize
pub fn argument_count(&self) -> usize
Returns a number of arguments.
sourcepub fn first_operation(&self) -> Option<OperationRef<'c, '_>>
pub fn first_operation(&self) -> Option<OperationRef<'c, '_>>
Returns a reference to the first operation.
sourcepub fn first_operation_mut(&mut self) -> Option<OperationRefMut<'c, '_>>
pub fn first_operation_mut(&mut self) -> Option<OperationRefMut<'c, '_>>
Returns a mutable reference to the first operation.
sourcepub fn terminator(&self) -> Option<OperationRef<'c, '_>>
pub fn terminator(&self) -> Option<OperationRef<'c, '_>>
Returns a reference to a terminator operation.
sourcepub fn terminator_mut(&mut self) -> Option<OperationRefMut<'c, '_>>
pub fn terminator_mut(&mut self) -> Option<OperationRefMut<'c, '_>>
Returns a mutable reference to a terminator operation.
sourcepub fn parent_region(&self) -> Option<RegionRef<'c, '_>>
pub fn parent_region(&self) -> Option<RegionRef<'c, '_>>
Returns a parent region.
sourcepub fn parent_operation(&self) -> Option<OperationRef<'c, '_>>
pub fn parent_operation(&self) -> Option<OperationRef<'c, '_>>
Returns a parent operation.
sourcepub fn add_argument(
&self,
type: Type<'c>,
location: Location<'c>
) -> Value<'c, '_>
pub fn add_argument( &self, type: Type<'c>, location: Location<'c> ) -> Value<'c, '_>
Adds an argument.
sourcepub fn append_operation(&self, operation: Operation<'c>) -> OperationRef<'c, '_>
pub fn append_operation(&self, operation: Operation<'c>) -> OperationRef<'c, '_>
Appends an operation.
sourcepub fn insert_operation(
&self,
position: usize,
operation: Operation<'c>
) -> OperationRef<'c, '_>
pub fn insert_operation( &self, position: usize, operation: Operation<'c> ) -> OperationRef<'c, '_>
Inserts an operation.
sourcepub fn insert_operation_after(
&self,
one: OperationRef<'c, '_>,
other: Operation<'c>
) -> OperationRef<'c, '_>
pub fn insert_operation_after( &self, one: OperationRef<'c, '_>, other: Operation<'c> ) -> OperationRef<'c, '_>
Inserts an operation after another.
sourcepub fn insert_operation_before(
&self,
one: OperationRef<'c, '_>,
other: Operation<'c>
) -> OperationRef<'c, '_>
pub fn insert_operation_before( &self, one: OperationRef<'c, '_>, other: Operation<'c> ) -> OperationRef<'c, '_>
Inserts an operation before another.
sourcepub unsafe fn detach(&self) -> Option<Block<'c>>
pub unsafe fn detach(&self) -> Option<Block<'c>>
Detaches a block from a region and assumes its ownership.
Safety
This function might invalidate existing references to the block if you drop it too early.
sourcepub fn next_in_region(&self) -> Option<BlockRef<'c, '_>>
pub fn next_in_region(&self) -> Option<BlockRef<'c, '_>>
Returns a next block in a region.
Trait Implementations§
source§impl<'c> PartialEq for Block<'c>
impl<'c> PartialEq for Block<'c>
impl<'c> Eq for Block<'c>
Auto Trait Implementations§
impl<'c> RefUnwindSafe for Block<'c>
impl<'c> !Send for Block<'c>
impl<'c> !Sync for Block<'c>
impl<'c> Unpin for Block<'c>
impl<'c> UnwindSafe for Block<'c>
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