pub struct ResultsOperation<'c> { /* private fields */ }
Expand description
A results
operation. Extract a result group from an operation.
pdl.results
operations extract a result group from an operation within a
pattern or rewrite region. If an index is provided, this operation extracts
a result group as defined by the ODS definition of the operation. In this
case the result of this operation may be either a single pdl.value
or
a pdl.range<value>
, depending on the constraint of the result in ODS. If
no index is provided, this operation extracts the full result range of the
operation.
Example:
// Extract all of the results of an operation:
%operation = pdl.operation ...
%results = pdl.results of %operation
// Extract the results in the first result group of an operation, which is
// variadic:
%operation = pdl.operation ...
%results = pdl.results 0 of %operation -> !pdl.range<value>
// Extract the results in the second result group of an operation, which is
// not variadic:
%operation = pdl.operation ...
%results = pdl.results 1 of %operation -> !pdl.value
Implementations§
source§impl<'c> ResultsOperation<'c>
impl<'c> ResultsOperation<'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>
) -> ResultsOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ResultsOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn val(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn parent(&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<ResultsOperation<'c>> for Operation<'c>
impl<'c> From<ResultsOperation<'c>> for Operation<'c>
source§fn from(operation: ResultsOperation<'c>) -> Self
fn from(operation: ResultsOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ResultsOperation<'c>
impl<'c> !Send for ResultsOperation<'c>
impl<'c> !Sync for ResultsOperation<'c>
impl<'c> Unpin for ResultsOperation<'c>
impl<'c> UnwindSafe for ResultsOperation<'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