pub struct ConsoleEval { /* private fields */ }Expand description
Async bridge between the sync TUI and an rpc::Session eval worker.
Implementations§
Source§impl ConsoleEval
impl ConsoleEval
Sourcepub fn submit(&mut self, form: String) -> Option<u64>
pub fn submit(&mut self, form: String) -> Option<u64>
Wraps form in a fresh (:id {next_id} :form {form}) envelope
and hands it to the worker. Non-blocking. Returns Some(id) with
the allocated envelope id on success, or None when the channel
is closed (the worker has stopped).
Sourcepub fn drain(&mut self) -> Vec<DrainItem>
pub fn drain(&mut self) -> Vec<DrainItem>
Drains every ready response without blocking. Each received wire
frame is parsed to extract its :id and classified as
DrainItem::Routed (positive id), DrainItem::Unroutable
(id 0 / non-integer id / parse error), or DrainItem::Notice
(worker-stopped plain-text, emitted at most once).
Sourcepub fn interrupt(&self)
pub fn interrupt(&self)
Requests a cooperative cancel of the in-flight eval. Advances the
interrupt generation first (caught by handle_form’s pre-start
check_interrupt if the eval has not entered Wasm yet) then bumps
the engine epoch (traps an eval already running) — the
eval_channel ordering that closes the worker-pickup window.
Sourcepub fn spawn(handle: &Handle, user_id: Uuid) -> Result<Self, SessionError>
pub fn spawn(handle: &Handle, user_id: Uuid) -> Result<Self, SessionError>
Builds a real Session for user_id and spawns its eval worker.
Auto Trait Implementations§
impl Freeze for ConsoleEval
impl !RefUnwindSafe for ConsoleEval
impl Send for ConsoleEval
impl Sync for ConsoleEval
impl Unpin for ConsoleEval
impl UnsafeUnpin for ConsoleEval
impl !UnwindSafe for ConsoleEval
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