Skip to main content

on_session_stack

Function on_session_stack 

Source
pub fn on_session_stack<R: Send>(session: impl FnOnce() -> R + Send) -> R
Expand description

Run one tree-walker session on a thread whose stack holds the full call depth (SESSION_STACK_BYTES), and hand its result back.

★ THE SESSION RUNS IN ITS CALLER’S WORLD. The page world (crate::semantics::world::PageWorld) moves to the session’s thread as the session starts and back as it ends, so the session reads what its caller set up and its caller reads what the session left — a session on its own stack is the session run in place, and nothing reads the world from the wrong thread. A session started inside a session runs where it is. A panic inside reaches the caller unchanged, after the world it left.