pub struct Postcondition {
pub result_binder: Pat,
pub body: Expr,
}Expand description
A postcondition.
§Example
The expression result != x in the following is a postcondition.
Note that result is an extra binder that represent the result of f, whose type is u8 in this case: the return type of f.
#[hax_lib::ensures(|result| result != x)]
fn f(x: u8) -> u8 { x.wrapping_add(1) }Fields§
§result_binder: PatIn the example, this is |result|.
body: ExprThe formula of the postcondition, result != x in the example.
Auto Trait Implementations§
impl Freeze for Postcondition
impl RefUnwindSafe for Postcondition
impl Send for Postcondition
impl Sync for Postcondition
impl Unpin for Postcondition
impl UnsafeUnpin for Postcondition
impl UnwindSafe for Postcondition
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more