pub struct RustFnWorker {
pub handler: WorkerJoinHandler,
}Expand description
Concrete Worker type for the RustFn kind — a handle to a task that
directly calls a Rust closure. Embeds a WorkerJoinHandler. Being a
pure function, there is minimal kind-specific extension surface here;
the primary purpose is to nail down the type binding.
Fields§
§handler: WorkerJoinHandlerThe join handle / cancellation token for the underlying task.
Trait Implementations§
Source§impl From<WorkerJoinHandler> for RustFnWorker
impl From<WorkerJoinHandler> for RustFnWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Converts to this type from the input type.
Source§impl Worker for RustFnWorker
impl Worker for RustFnWorker
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 RustFnWorker
impl !UnwindSafe for RustFnWorker
impl Freeze for RustFnWorker
impl Send for RustFnWorker
impl Sync for RustFnWorker
impl Unpin for RustFnWorker
impl UnsafeUnpin for RustFnWorker
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