pub struct MiddlewareWorker {
pub handler: WorkerJoinHandler,
}Expand description
Generic Worker used only on the middleware (wrap_join) wrap path,
so kind-agnostic post-processing wrap results can be returned as
Box<dyn Worker>. Unlike a per-kind Worker, this does not represent
“a specific kind’s execution” — it is a thin wrapper that layers a
post-processor on top of an existing Worker.
Named after its role: the “Worker for the middleware path” — the
type boxed as the return value by wrap_join consumers (Audit /
MainAI / Senior / LongHold / Lua after-hook, and so on).
Fields§
§handler: WorkerJoinHandlerThe wrapped completion handle; join delegates to this.
Trait Implementations§
Source§impl From<WorkerJoinHandler> for MiddlewareWorker
impl From<WorkerJoinHandler> for MiddlewareWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Converts to this type from the input type.
Source§impl Worker for MiddlewareWorker
impl Worker for MiddlewareWorker
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 MiddlewareWorker
impl !UnwindSafe for MiddlewareWorker
impl Freeze for MiddlewareWorker
impl Send for MiddlewareWorker
impl Sync for MiddlewareWorker
impl Unpin for MiddlewareWorker
impl UnsafeUnpin for MiddlewareWorker
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