Struct melior::dialect::ods::pdl_interp::GetOperandsOperation
source · pub struct GetOperandsOperation<'c> { /* private fields */ }
Expand description
A get_operands
operation. Get a specified operand group from an Operation
.
pdl_interp.get_operands
operations try to get a specific operand
group from an operation. If the expected result is a single Value, null is
returned if the operand group is not of size 1. If a range is expected,
null is returned if the operand group is invalid. If no index is provided,
the returned operand group corresponds to all operands of the operation.
Example:
// Get the first group of operands from an operation, and expect a single
// element.
%operand = pdl_interp.get_operands 0 of %op : !pdl.value
// Get the first group of operands from an operation.
%operands = pdl_interp.get_operands 0 of %op : !pdl.range<value>
// Get all of the operands from an operation.
%operands = pdl_interp.get_operands of %op : !pdl.range<value>
Implementations§
source§impl<'c> GetOperandsOperation<'c>
impl<'c> GetOperandsOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> GetOperandsOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> GetOperandsOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn value(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn input_op(&self) -> Result<Value<'c, '_>, Error>
pub fn index(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_index(&mut self, value: IntegerAttribute<'c>)
pub fn remove_index(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<GetOperandsOperation<'c>> for Operation<'c>
impl<'c> From<GetOperandsOperation<'c>> for Operation<'c>
source§fn from(operation: GetOperandsOperation<'c>) -> Self
fn from(operation: GetOperandsOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for GetOperandsOperation<'c>
impl<'c> !Send for GetOperandsOperation<'c>
impl<'c> !Sync for GetOperandsOperation<'c>
impl<'c> Unpin for GetOperandsOperation<'c>
impl<'c> UnwindSafe for GetOperandsOperation<'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