pub struct OpFn<'a> { /* private fields */ }Expand description
An operator argument, compiled: its parameters’ slots and its body.
Implementations§
Source§impl<'a> OpFn<'a>
impl<'a> OpFn<'a>
Sourcepub fn new(code: &'a Code, params: &'a [u32], body: P) -> Self
pub fn new(code: &'a Code, params: &'a [u32], body: P) -> Self
The operator whose parameters are params and whose body is body.
Sourcepub fn apply(&self, m: &mut Machine, args: &[Handle]) -> Result<Handle, Error>
pub fn apply(&self, m: &mut Machine, args: &[Handle]) -> Result<Handle, Error>
Applies the operator to args, as TLC applies an operator argument
from a Java override: the parameters are bound to the values, the
body is evaluated (normalized), and the slots are restored.
§Errors
The body’s evaluation errors; internal for an arity mismatch.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for OpFn<'a>
impl<'a> !UnwindSafe for OpFn<'a>
impl<'a> Forget for OpFn<'a>
impl<'a> Freeze for OpFn<'a>
impl<'a> Move for OpFn<'a>
impl<'a> Send for OpFn<'a>
impl<'a> Sync for OpFn<'a>
impl<'a> Unpin for OpFn<'a>
impl<'a> UnsafeUnpin for OpFn<'a>
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