pub struct BackgroundTaskPlugin { /* private fields */ }Expand description
Plugin that registers the background task view state key and the persisted task metadata state key.
Implementations§
Source§impl BackgroundTaskPlugin
impl BackgroundTaskPlugin
pub fn new(manager: Arc<BackgroundTaskManager>) -> Self
Sourcepub fn with_store(
manager: Arc<BackgroundTaskManager>,
store: StateStore,
) -> Self
pub fn with_store( manager: Arc<BackgroundTaskManager>, store: StateStore, ) -> Self
Create the plugin and wire the store into the manager.
Sourcepub fn manager(&self) -> &Arc<BackgroundTaskManager>
pub fn manager(&self) -> &Arc<BackgroundTaskManager>
Return the manager for inbox wiring.
Trait Implementations§
Source§impl Plugin for BackgroundTaskPlugin
impl Plugin for BackgroundTaskPlugin
fn descriptor(&self) -> PluginDescriptor
Source§fn bind_runtime_context(
&self,
store: &StateStore,
owner_inbox: Option<&InboxSender>,
)
fn bind_runtime_context( &self, store: &StateStore, owner_inbox: Option<&InboxSender>, )
Bind per-run runtime context to the plugin instance. Read more
Source§fn register(&self, registrar: &mut PluginRegistrar) -> Result<(), StateError>
fn register(&self, registrar: &mut PluginRegistrar) -> Result<(), StateError>
Declare capabilities: state keys, hooks, action handlers, effect handlers, permission checkers.
Called once per resolve to build the ExecutionEnv.
Source§fn on_activate(
&self,
_agent_spec: &AgentSpec,
_patch: &mut MutationBatch,
) -> Result<(), StateError>
fn on_activate( &self, _agent_spec: &AgentSpec, _patch: &mut MutationBatch, ) -> Result<(), StateError>
Agent activated: read spec config, write initial state.
Called when this plugin becomes active for a specific agent.
Source§fn config_schemas(&self) -> Vec<ConfigSchema>
fn config_schemas(&self) -> Vec<ConfigSchema>
Declare config section schemas for eager validation during resolve. Read more
Source§fn on_deactivate(&self, _patch: &mut MutationBatch) -> Result<(), StateError>
fn on_deactivate(&self, _patch: &mut MutationBatch) -> Result<(), StateError>
Agent deactivated: clean up agent-scoped state.
Called when switching away from an agent that uses this plugin.
Auto Trait Implementations§
impl Freeze for BackgroundTaskPlugin
impl !RefUnwindSafe for BackgroundTaskPlugin
impl Send for BackgroundTaskPlugin
impl Sync for BackgroundTaskPlugin
impl Unpin for BackgroundTaskPlugin
impl UnsafeUnpin for BackgroundTaskPlugin
impl !UnwindSafe for BackgroundTaskPlugin
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