pub struct Operation<'c> { /* private fields */ }
Expand description
An operation.
Implementations§
source§impl<'c> Operation<'c>
impl<'c> 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 next 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.
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>
sourcepub fn into_raw(self) -> MlirOperation
pub fn into_raw(self) -> MlirOperation
Converts an operation into a raw object.