Trait creusot_contracts::std::ops::FnExt

source ·
pub trait FnExt<Args: Tuple>: FnMutExt<Args> {
    // Required methods
    fn postcondition(self, _: Args, _: Self::Output) -> bool;
    fn fn_mut(self, args: Args, res_state: Self, res: Self::Output);
    fn fn_once(self, args: Args, res: Self::Output)
       where Self: Sized;
}
Expand description

FnExt is an extension trait for the Fn trait, used for adding a specification to closures. It should not be used directly.

Required Methods§

source

fn postcondition(self, _: Args, _: Self::Output) -> bool

logic(prophetic)

source

fn fn_mut(self, args: Args, res_state: Self, res: Self::Output)

law

ensures

self.postcondition_mut(args, res_state, res) == (self == res_state && self.postcondition(args, res))
source

fn fn_once(self, args: Args, res: Self::Output)
where Self: Sized,

law

ensures

self.postcondition_once(args, res) == (resolve(&self) && self.postcondition(args, res))

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Args: Tuple, F: Fn<Args>> FnExt<Args> for F