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) -> ^defaultDestImplementations§
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> Clone for SwitchAttributeOperation<'c>
impl<'c> Clone for SwitchAttributeOperation<'c>
Source§fn clone(&self) -> SwitchAttributeOperation<'c>
fn clone(&self) -> SwitchAttributeOperation<'c>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'c> Debug for SwitchAttributeOperation<'c>
impl<'c> Debug for SwitchAttributeOperation<'c>
Source§impl<'b> From<SwitchAttributeOperation<'b>> for PdlInterpDialectOperation<'b>
impl<'b> From<SwitchAttributeOperation<'b>> for PdlInterpDialectOperation<'b>
Source§fn from(op: SwitchAttributeOperation<'b>) -> Self
fn from(op: SwitchAttributeOperation<'b>) -> Self
Converts to this type from the input type.
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.
Source§impl<'c> PartialEq for SwitchAttributeOperation<'c>
impl<'c> PartialEq for SwitchAttributeOperation<'c>
Source§fn eq(&self, other: &SwitchAttributeOperation<'c>) -> bool
fn eq(&self, other: &SwitchAttributeOperation<'c>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'c> TryFrom<Operation<'c>> for SwitchAttributeOperation<'c>
impl<'c> TryFrom<Operation<'c>> for SwitchAttributeOperation<'c>
impl<'c> Eq for SwitchAttributeOperation<'c>
impl<'c> StructuralPartialEq for SwitchAttributeOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for SwitchAttributeOperation<'c>
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