pub struct OperatorSpawner { /* private fields */ }Expand description
A SpawnerAdapter implementation that hands the dispatch off to an
Arc<dyn Operator>.
OperatorSpawner itself does not inspect the operator’s kind —
MainAi / Human / Automate / Composite all go through the same
path, and the operator implementation absorbs the differences.
§Position — the AgentSpec-axis Operator path
Use this type on the path that bakes a separate Operator backend
into every AgentDef. For an AgentKind::Operator AgentDef, the
OperatorSpawnerFactory produces one with OperatorSpawner::new(op)
and places it in routes[agent_name]. Agents flowing in through the
agent.md loader default to kind = Operator, so they land here.
The paired Blueprint-global (session) axis is
crate::middleware::OperatorDelegateMiddleware — a single operator
backend registered on the session and applied uniformly across every
agent. When both are effective, the delegate middleware sits at the
outer end of the stack and bypasses inner.spawn; this type is inert
and no double fire can occur. See the OperatorSpawnerFactory doc
for the exclusivity narrative.
Implementations§
Trait Implementations§
Source§impl SpawnerAdapter for OperatorSpawner
impl SpawnerAdapter for OperatorSpawner
Source§fn spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
engine: &'life1 Engine,
ctx: &'life2 Ctx,
task_id: TaskId,
attempt: u32,
token: CapToken,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Worker>, SpawnError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
engine: &'life1 Engine,
ctx: &'life2 Ctx,
task_id: TaskId,
attempt: u32,
token: CapToken,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Worker>, SpawnError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Box<dyn Worker>. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OperatorSpawner
impl !UnwindSafe for OperatorSpawner
impl Freeze for OperatorSpawner
impl Send for OperatorSpawner
impl Sync for OperatorSpawner
impl Unpin for OperatorSpawner
impl UnsafeUnpin for OperatorSpawner
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<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>
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