Struct melior::dialect::ods::pdl_interp::SwitchAttributeOperation
source · pub struct SwitchAttributeOperation<'c> { /* private fields */ }
Expand description
A switch_attribute
operation. Switch on the value of an Attribute
.
pdl_interp.switch_attribute
operations compare the value of a given
attribute with a set of constant attributes. If the value matches one of the
provided case values the destination for that case value is taken, otherwise
the default destination is taken.
Example:
pdl_interp.switch_attribute %attr to [10, true](^10Dest, ^trueDest) -> ^defaultDest
Implementations§
source§impl<'c> SwitchAttributeOperation<'c>
impl<'c> SwitchAttributeOperation<'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>
) -> SwitchAttributeOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> SwitchAttributeOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn attribute(&self) -> Result<Value<'c, '_>, Error>
pub fn default_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn cases(&self) -> impl Iterator<Item = BlockRef<'c, '_>>
pub fn case_values(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_case_values(&mut self, value: ArrayAttribute<'c>)
Trait Implementations§
source§impl<'c> From<SwitchAttributeOperation<'c>> for Operation<'c>
impl<'c> From<SwitchAttributeOperation<'c>> for Operation<'c>
source§fn from(operation: SwitchAttributeOperation<'c>) -> Self
fn from(operation: SwitchAttributeOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for SwitchAttributeOperation<'c>
impl<'c> !Send for SwitchAttributeOperation<'c>
impl<'c> !Sync for SwitchAttributeOperation<'c>
impl<'c> Unpin for SwitchAttributeOperation<'c>
impl<'c> UnwindSafe for SwitchAttributeOperation<'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