pub struct AssertOperation<'c> { /* private fields */ }
Expand description
An assert
operation. Assert operation with message attribute.
Assert operation with single boolean operand and an error message attribute.
If the argument is true
this operation has no effect. Otherwise, the
program execution will abort. The provided error message may be used by a
runtime to propagate the error to the user.
Example:
assert %b, "Expected ... to be true"
Implementations§
source§impl<'c> AssertOperation<'c>
impl<'c> AssertOperation<'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>
) -> AssertOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> AssertOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn arg(&self) -> Result<Value<'c, '_>, Error>
pub fn msg(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_msg(&mut self, value: StringAttribute<'c>)
Trait Implementations§
source§impl<'c> From<AssertOperation<'c>> for Operation<'c>
impl<'c> From<AssertOperation<'c>> for Operation<'c>
source§fn from(operation: AssertOperation<'c>) -> Self
fn from(operation: AssertOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for AssertOperation<'c>
impl<'c> !Send for AssertOperation<'c>
impl<'c> !Sync for AssertOperation<'c>
impl<'c> Unpin for AssertOperation<'c>
impl<'c> UnwindSafe for AssertOperation<'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