pub struct CronHandler { /* private fields */ }Expand description
Cron handler — owns the live job list for dynamic scheduling.
The on_create callback is called whenever a new cron job is created
via the create_cron tool. Callers that don’t need side-effects pass |_| {}.
Implementations§
Source§impl CronHandler
impl CronHandler
Sourcepub fn new<F: Fn(CronJob) + Send + Sync + 'static>(
jobs: Vec<CronJob>,
on_create: F,
) -> Self
pub fn new<F: Fn(CronJob) + Send + Sync + 'static>( jobs: Vec<CronJob>, on_create: F, ) -> Self
Create a handler from an initial set of jobs and a creation callback.
on_create is called after each dynamic create_cron tool invocation.
Pass |_| {} if no side-effect is needed.
Trait Implementations§
Source§impl Hook for CronHandler
impl Hook for CronHandler
Source§fn on_register_tools(
&self,
registry: &mut ToolRegistry,
) -> impl Future<Output = ()> + Send
fn on_register_tools( &self, registry: &mut ToolRegistry, ) -> impl Future<Output = ()> + Send
Called by
Runtime::new() to register tools into the shared registry. Read moreSource§fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
Auto Trait Implementations§
impl Freeze for CronHandler
impl !RefUnwindSafe for CronHandler
impl Send for CronHandler
impl Sync for CronHandler
impl Unpin for CronHandler
impl UnsafeUnpin for CronHandler
impl !UnwindSafe for CronHandler
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