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) -> bool
pub fn submit(&mut self, form: String) -> bool
Wraps form in a fresh (:id {next_id} :form {form}) envelope
and hands it to the worker. Non-blocking. Returns false when the
channel is closed (the worker has stopped) so the caller can
surface a notice instead of leaving the console silently hung.
Sourcepub fn drain(&mut self) -> Vec<String>
pub fn drain(&mut self) -> Vec<String>
Drains every ready response without blocking. If the result
channel has disconnected (the worker exited, possibly mid-eval),
surfaces a single [WORKER_STOPPED_NOTICE] line into the drained
results so a silently hung submission becomes visible; the notice
is 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