pub struct OperationRefMut<'c, 'a> { /* private fields */ }Expand description
A mutable reference to an operation.
Implementations§
Source§impl OperationRefMut<'_, '_>
impl OperationRefMut<'_, '_>
Sourcepub const fn to_raw(self) -> MlirOperation
pub const fn to_raw(self) -> MlirOperation
Converts an operation reference into a raw object.
Sourcepub unsafe fn from_raw(raw: MlirOperation) -> Self
pub unsafe fn from_raw(raw: MlirOperation) -> Self
Sourcepub unsafe fn from_option_raw(raw: MlirOperation) -> Option<Self>
pub unsafe fn from_option_raw(raw: MlirOperation) -> Option<Self>
Methods from Deref<Target = Operation<'c>>§
Sourcepub fn context(&self) -> ContextRef<'c>
pub fn context(&self) -> ContextRef<'c>
Returns a context.
Sourcepub fn name(&self) -> Identifier<'c>
pub fn name(&self) -> Identifier<'c>
Returns a name.
Sourcepub fn operand_count(&self) -> usize
pub fn operand_count(&self) -> usize
Returns the number of operands.
Sourcepub fn operand(&self, index: usize) -> Result<Value<'c, '_>, Error>
pub fn operand(&self, index: usize) -> Result<Value<'c, '_>, Error>
Returns the operand at a position.
Sourcepub fn result_count(&self) -> usize
pub fn result_count(&self) -> usize
Returns the number of results.
Sourcepub fn result(&self, index: usize) -> Result<OperationResult<'c, '_>, Error>
pub fn result(&self, index: usize) -> Result<OperationResult<'c, '_>, Error>
Returns a result at a position.
Sourcepub fn results(&self) -> impl Iterator<Item = OperationResult<'c, '_>>
pub fn results(&self) -> impl Iterator<Item = OperationResult<'c, '_>>
Returns all results.
Sourcepub fn region_count(&self) -> usize
pub fn region_count(&self) -> usize
Returns the number of regions.
Sourcepub fn region(&self, index: usize) -> Result<RegionRef<'c, '_>, Error>
pub fn region(&self, index: usize) -> Result<RegionRef<'c, '_>, Error>
Returns a region at a position.
Sourcepub fn successor_count(&self) -> usize
pub fn successor_count(&self) -> usize
Returns the number of successors.
Sourcepub fn successor(&self, index: usize) -> Result<BlockRef<'c, '_>, Error>
pub fn successor(&self, index: usize) -> Result<BlockRef<'c, '_>, Error>
Returns a successor at a position.
Sourcepub fn successors(&self) -> impl Iterator<Item = BlockRef<'c, '_>>
pub fn successors(&self) -> impl Iterator<Item = BlockRef<'c, '_>>
Returns all successors.
Sourcepub fn attribute_count(&self) -> usize
pub fn attribute_count(&self) -> usize
Returns the number of attributes.
Sourcepub fn attribute_at(
&self,
index: usize,
) -> Result<(Identifier<'c>, Attribute<'c>), Error>
pub fn attribute_at( &self, index: usize, ) -> Result<(Identifier<'c>, Attribute<'c>), Error>
Returns a attribute at a position.
Sourcepub fn attributes(
&self,
) -> impl Iterator<Item = (Identifier<'c>, Attribute<'c>)> + '_
pub fn attributes( &self, ) -> impl Iterator<Item = (Identifier<'c>, Attribute<'c>)> + '_
Returns all attributes.
Sourcepub fn attribute(&self, name: &str) -> Result<Attribute<'c>, Error>
pub fn attribute(&self, name: &str) -> Result<Attribute<'c>, Error>
Returns a attribute with the given name.
Sourcepub fn has_attribute(&self, name: &str) -> bool
pub fn has_attribute(&self, name: &str) -> bool
Checks if the operation has a attribute with the given name.
Sourcepub fn set_attribute(&mut self, name: &str, attribute: Attribute<'c>)
pub fn set_attribute(&mut self, name: &str, attribute: Attribute<'c>)
Sets the attribute with the given name to the given attribute.
Sourcepub fn remove_attribute(&mut self, name: &str) -> Result<(), Error>
pub fn remove_attribute(&mut self, name: &str) -> Result<(), Error>
Removes the attribute with the given name.
Sourcepub fn next_in_block(&self) -> Option<OperationRef<'c, '_>>
pub fn next_in_block(&self) -> Option<OperationRef<'c, '_>>
Returns a reference to the next operation in the same block.
Sourcepub fn next_in_block_mut(&self) -> Option<OperationRefMut<'c, '_>>
pub fn next_in_block_mut(&self) -> Option<OperationRefMut<'c, '_>>
Returns a mutable reference to the next operation in the same block.
Sourcepub fn previous_in_block(&self) -> Option<OperationRef<'c, '_>>
pub fn previous_in_block(&self) -> Option<OperationRef<'c, '_>>
Returns a reference to the previous operation in the same block.
Sourcepub fn parent_operation(&self) -> Option<OperationRef<'c, '_>>
pub fn parent_operation(&self) -> Option<OperationRef<'c, '_>>
Returns a reference to a parent operation.
Sourcepub fn remove_from_parent(&mut self)
pub fn remove_from_parent(&mut self)
Removes itself from a parent block.
Sourcepub fn to_string_with_flags(
&self,
flags: OperationPrintingFlags,
) -> Result<String, Error>
pub fn to_string_with_flags( &self, flags: OperationPrintingFlags, ) -> Result<String, Error>
Prints an operation with flags.
Trait Implementations§
Source§impl<'c, 'a> Clone for OperationRefMut<'c, 'a>
impl<'c, 'a> Clone for OperationRefMut<'c, 'a>
Source§fn clone(&self) -> OperationRefMut<'c, 'a>
fn clone(&self) -> OperationRefMut<'c, 'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more