Struct melior::dialect::ods::pdl_interp::CheckResultCountOperation
source · pub struct CheckResultCountOperation<'c> { /* private fields */ }
Expand description
A check_result_count
operation. Check the number of results of an Operation
.
pdl_interp.check_result_count
operations compare the number of results
of a given operation value with a constant. The comparison is either exact
or at_least, with the latter used to compare against a minimum number of
expected results. On success, this operation branches to the true
destination, otherwise the false destination is taken.
Example:
// Check for exact equality.
pdl_interp.check_result_count of %op is 2 -> ^matchDest, ^failureDest
// Check for at least N results.
pdl_interp.check_result_count of %op is at_least 2 -> ^matchDest, ^failureDest
Implementations§
source§impl<'c> CheckResultCountOperation<'c>
impl<'c> CheckResultCountOperation<'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>
) -> CheckResultCountOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> CheckResultCountOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn input_op(&self) -> Result<Value<'c, '_>, Error>
pub fn true_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn false_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn count(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_count(&mut self, value: IntegerAttribute<'c>)
pub fn compare_at_least(&self) -> Result<Attribute<'c>, Error>
pub fn set_compare_at_least(&mut self, value: Attribute<'c>)
pub fn remove_compare_at_least(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<CheckResultCountOperation<'c>> for Operation<'c>
impl<'c> From<CheckResultCountOperation<'c>> for Operation<'c>
source§fn from(operation: CheckResultCountOperation<'c>) -> Self
fn from(operation: CheckResultCountOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for CheckResultCountOperation<'c>
impl<'c> !Send for CheckResultCountOperation<'c>
impl<'c> !Sync for CheckResultCountOperation<'c>
impl<'c> Unpin for CheckResultCountOperation<'c>
impl<'c> UnwindSafe for CheckResultCountOperation<'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