pub struct AssumingAllOperation<'c> { /* private fields */ }
Expand description
An assuming_all
operation. Return a logical AND of all witnesses.
Used to simplify constraints as any single failing precondition is enough to prevent execution.
“assuming” operations represent an execution order restriction to the compiler, information for dependent code to rely on (by assuming), and nothing else. They should not exist after a program is fully lowered and ready to execute.
Example:
%w0 = shape.cstr_broadcastable [2,2], [3,1,2] // Passing
%w1 = shape.cstr_broadcastable [2,2], [3,2] // Failure
%w2 = shape.cstr_eq [1,2], [1,2], [1,2] // Passing
%wf = shape.assuming_all %w0, %w1 // Failure
%wt = shape.assuming_all %w0, %w2 // Passing
Implementations§
source§impl<'c> AssumingAllOperation<'c>
impl<'c> AssumingAllOperation<'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>
) -> AssumingAllOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> AssumingAllOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn inputs(&self) -> impl Iterator<Item = Value<'c, '_>>
Trait Implementations§
source§impl<'c> From<AssumingAllOperation<'c>> for Operation<'c>
impl<'c> From<AssumingAllOperation<'c>> for Operation<'c>
source§fn from(operation: AssumingAllOperation<'c>) -> Self
fn from(operation: AssumingAllOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for AssumingAllOperation<'c>
impl<'c> !Send for AssumingAllOperation<'c>
impl<'c> !Sync for AssumingAllOperation<'c>
impl<'c> Unpin for AssumingAllOperation<'c>
impl<'c> UnwindSafe for AssumingAllOperation<'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