pub struct AgentBlockWorker {
pub handler: WorkerJoinHandler,
}Expand description
Concrete Worker type for the AgentBlock kind — the handle for an
LLM call routed through the agent-block-core SDK. Embeds a
WorkerJoinHandler to carry the async signal. The intent is to
eventually keep the SDK-specific quirks — the agent_result event
name, payload shape, shutdown-token bridging, agent_result.content
normalisation — contained inside this struct. Today it lands as a
thin shape holding only the async signal; Phase B adds the
normalisation layer here and structurally eliminates the
token-boilerplate waste observed in observation #2.
Fields§
§handler: WorkerJoinHandlerThe completion-signal handle for this agent-block SDK call’s spawned task.
Trait Implementations§
Source§impl From<WorkerJoinHandler> for AgentBlockWorker
impl From<WorkerJoinHandler> for AgentBlockWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Converts to this type from the input type.
Source§impl Worker for AgentBlockWorker
impl Worker for AgentBlockWorker
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 AgentBlockWorker
impl !UnwindSafe for AgentBlockWorker
impl Freeze for AgentBlockWorker
impl Send for AgentBlockWorker
impl Sync for AgentBlockWorker
impl Unpin for AgentBlockWorker
impl UnsafeUnpin for AgentBlockWorker
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