pub struct LuaWorker {
pub handler: WorkerJoinHandler,
}Expand description
Concrete Worker type for the Lua kind — a handle to a Lua-eval task
inside an mlua VM. Embeds a WorkerJoinHandler. Reserved as the home
for future Lua-specific extensions (an mlua VM cancellation
mechanism, Lua-side error type retention, and so on).
Fields§
§handler: WorkerJoinHandlerThe join handle / cancellation token for the underlying task.
Trait Implementations§
Source§impl From<WorkerJoinHandler> for LuaWorker
impl From<WorkerJoinHandler> for LuaWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Converts to this type from the input type.
Source§impl Worker for LuaWorker
impl Worker for LuaWorker
Source§fn id(&self) -> &WorkerId
fn id(&self) -> &WorkerId
This worker’s identity — used for logging and to tie cancellation
back to the right worker.
Source§fn cancel_token(&self) -> CancellationToken
fn cancel_token(&self) -> CancellationToken
Token that carries the cancel signal. Clonable — this is the
path the engine uses to cancel from the outside.
Source§fn join<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn join<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
Await the completion signal. The worker is consumed — one
worker, one join.
Ok(()) means the worker ran to completion;
Err means it was cancelled, failed, or panicked internally.
Values do not come back through this trait; use
engine.output_tail for those.Auto Trait Implementations§
impl !RefUnwindSafe for LuaWorker
impl !UnwindSafe for LuaWorker
impl Freeze for LuaWorker
impl Send for LuaWorker
impl Sync for LuaWorker
impl Unpin for LuaWorker
impl UnsafeUnpin for LuaWorker
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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