Skip to main content

Module callback

Module callback 

Source
Expand description

Thread-local eval context for Rust→Clojure callbacks.

When a native (Rust) builtin needs to call a Clojure function — for example, a comparator passed to sort-by — it can use invoke to do so. The eval context is pushed automatically before every native function call and popped afterward, so invoke is always available inside builtins.

Functions§

capture_eval_context
Capture the current eval context so it can be installed on another thread.
install_eval_context
Install a previously captured eval context on the current thread.
invoke
pop_eval_context
Pop the eval context after a native function returns.
push_eval_context
Push the current eval context before calling a native function.
with_eval_context
Call a Clojure-callable Value with the given arguments.