Skip to main content

session

Function session 

Source
pub fn session(context: &mut Context<'_>) -> SessionGuard
Expand description

Publish context’s interpreter for the C API until the returned guard is dropped.

The context is also adopted by the session’s runtime for the duration, so JS_NewClass — which takes a JSRuntime * — mirrors its definition into this interpreter. That is the one piece of state a native module needs and cannot get any other way.