pub struct BlockRef<'c, 'a> { /* private fields */ }Expand description
A reference of a block.
Implementations§
Methods from Deref<Target = Block<'a>>§
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 terminator(&self) -> Option<OperationRef<'c, '_>>
pub fn terminator(&self) -> Option<OperationRef<'c, '_>>
Returns a 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§
impl<'c, 'a> Copy for BlockRef<'c, 'a>
impl Eq for BlockRef<'_, '_>
Auto Trait Implementations§
impl<'c, 'a> Freeze for BlockRef<'c, 'a>
impl<'c, 'a> RefUnwindSafe for BlockRef<'c, 'a>
impl<'c, 'a> !Send for BlockRef<'c, 'a>
impl<'c, 'a> !Sync for BlockRef<'c, 'a>
impl<'c, 'a> Unpin for BlockRef<'c, 'a>
impl<'c, 'a> UnsafeUnpin for BlockRef<'c, 'a>
impl<'c, 'a> UnwindSafe for BlockRef<'c, 'a>
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