pub struct ConstWitnessOperation<'c> { /* private fields */ }
Expand description
A const_witness
operation. An operation that returns a statically known witness value.
This operation represents a statically known witness result. This can be often used to canonicalize/fold constraint and assuming code that will always pass.
%0 = shape.const_shape [1,2,3]
%1 = shape.const_shape [1,2,3]
%w0 = shape.cstr_eq(%0, %1) // Can be folded to "const_witness true"
%w1 = shape.const_witness true
%w2 = shape.assuming_all(%w0, %w2) // Can be folded to "const_witness true"
Implementations§
source§impl<'c> ConstWitnessOperation<'c>
impl<'c> ConstWitnessOperation<'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>
) -> ConstWitnessOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ConstWitnessOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn passing(&self) -> Result<Attribute<'c>, Error>
pub fn set_passing(&mut self, value: Attribute<'c>)
Trait Implementations§
source§impl<'c> From<ConstWitnessOperation<'c>> for Operation<'c>
impl<'c> From<ConstWitnessOperation<'c>> for Operation<'c>
source§fn from(operation: ConstWitnessOperation<'c>) -> Self
fn from(operation: ConstWitnessOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ConstWitnessOperation<'c>
impl<'c> !Send for ConstWitnessOperation<'c>
impl<'c> !Sync for ConstWitnessOperation<'c>
impl<'c> Unpin for ConstWitnessOperation<'c>
impl<'c> UnwindSafe for ConstWitnessOperation<'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