pub struct HandlerRegistry { /* private fields */ }Expand description
Registry of named handlers and agents for pipeline execution.
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
pub fn new() -> Self
Sourcepub fn handler<F, Fut>(&mut self, name: impl Into<String>, f: F)
pub fn handler<F, Fut>(&mut self, name: impl Into<String>, f: F)
Register a plain async handler by name.
Sourcepub fn agent<A>(&mut self, name: impl Into<String>)
pub fn agent<A>(&mut self, name: impl Into<String>)
Register a cruxx Agent by name for delegation.
The agent’s run method will be called with a fresh CruxCtx.
Sourcepub fn get_handler(&self, name: &str) -> Option<&BoxHandler>
pub fn get_handler(&self, name: &str) -> Option<&BoxHandler>
Look up a handler by name.
Sourcepub fn get_agent(&self, name: &str) -> Option<&BoxAgentRunner>
pub fn get_agent(&self, name: &str) -> Option<&BoxAgentRunner>
Look up an agent runner by name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandlerRegistry
impl !RefUnwindSafe for HandlerRegistry
impl Send for HandlerRegistry
impl Sync for HandlerRegistry
impl Unpin for HandlerRegistry
impl UnsafeUnpin for HandlerRegistry
impl !UnwindSafe for HandlerRegistry
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