pub struct SessionData { /* private fields */ }Expand description
Wasmtime Store data type for the rpc eval channel. Carries the
per-session user context (ScriptCtx) so native fns reach
caller.data().ctx().user_id directly. The legacy
EvalContext capture-protocol companion field retired alongside
the capture imports in P4 A6.c — nomi-eval now returns its
final value via the function’s (ref null any) return slot.
Native fns are async (Linker::func_wrap_async) — they .await
server::command::* futures directly on whatever runtime drives the
surrounding Session::handle_form call. No owned runtime, no
spawn_blocking, no thread-local pool concerns.
Implementations§
Source§impl SessionData
impl SessionData
pub fn ctx(&self) -> &ScriptCtx
Sourcepub fn with_draft<F>(&self, f: F) -> Result<()>where
F: FnOnce(&mut TransactionDraft),
pub fn with_draft<F>(&self, f: F) -> Result<()>where
F: FnOnce(&mut TransactionDraft),
Mutates the draft accumulator if armed (render path). Returns an error on the normal eval path where no draft is present — a draft native reaching a non-render Store is a wiring bug, surfaced as a trap.
Sourcepub fn into_draft(self) -> Option<TransactionDraft>
pub fn into_draft(self) -> Option<TransactionDraft>
Consumes the accumulated draft, if any. Called after a render run via
store.into_data().
Sourcepub fn push_output(&self, msg: &str)
pub fn push_output(&self, msg: &str)
Appends a script-output line to the per-request buffer. Called by the
env.log host fn. A poisoned lock is swallowed (output capture is
best-effort telemetry, never a reason to fail an eval).
Auto Trait Implementations§
impl !Freeze for SessionData
impl !RefUnwindSafe for SessionData
impl Send for SessionData
impl !Sync for SessionData
impl Unpin for SessionData
impl UnsafeUnpin for SessionData
impl UnwindSafe for SessionData
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more