pub struct TaskConfigManager { /* private fields */ }Expand description
Manages per-task Think More configuration with context storage
Implementations§
Source§impl TaskConfigManager
impl TaskConfigManager
Sourcepub fn register_task(
&self,
task_id: String,
config: ThinkMoreConfig,
) -> Result<()>
pub fn register_task( &self, task_id: String, config: ThinkMoreConfig, ) -> Result<()>
Register a task with its configuration
Sourcepub fn get_task_config(&self, task_id: &str) -> Result<Option<ThinkMoreConfig>>
pub fn get_task_config(&self, task_id: &str) -> Result<Option<ThinkMoreConfig>>
Get the configuration for a task
Sourcepub fn update_task_config(
&self,
task_id: &str,
config: ThinkMoreConfig,
) -> Result<()>
pub fn update_task_config( &self, task_id: &str, config: ThinkMoreConfig, ) -> Result<()>
Update the configuration for a task
Sourcepub fn unregister_task(&self, task_id: &str) -> Result<()>
pub fn unregister_task(&self, task_id: &str) -> Result<()>
Unregister a task
Sourcepub fn add_task_context(
&self,
task_id: &str,
key: String,
value: Value,
) -> Result<()>
pub fn add_task_context( &self, task_id: &str, key: String, value: Value, ) -> Result<()>
Add context data to a task
Sourcepub fn get_task_context(
&self,
task_id: &str,
key: &str,
) -> Result<Option<Value>>
pub fn get_task_context( &self, task_id: &str, key: &str, ) -> Result<Option<Value>>
Get context data from a task
Sourcepub fn remove_task_context(
&self,
task_id: &str,
key: &str,
) -> Result<Option<Value>>
pub fn remove_task_context( &self, task_id: &str, key: &str, ) -> Result<Option<Value>>
Remove context data from a task
Sourcepub fn clear_task_context(&self, task_id: &str) -> Result<()>
pub fn clear_task_context(&self, task_id: &str) -> Result<()>
Clear all context data for a task
Sourcepub fn get_all_task_ids(&self) -> Result<Vec<String>>
pub fn get_all_task_ids(&self) -> Result<Vec<String>>
Get all registered task IDs
Sourcepub fn task_count(&self) -> Result<usize>
pub fn task_count(&self) -> Result<usize>
Get the number of registered tasks
Sourcepub fn clear_all_tasks(&self) -> Result<()>
pub fn clear_all_tasks(&self) -> Result<()>
Clear all tasks
Sourcepub fn get_all_configs(&self) -> Result<Vec<TaskConfig>>
pub fn get_all_configs(&self) -> Result<Vec<TaskConfig>>
Get all task configurations
Trait Implementations§
Source§impl Clone for TaskConfigManager
impl Clone for TaskConfigManager
Source§fn clone(&self) -> TaskConfigManager
fn clone(&self) -> TaskConfigManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskConfigManager
impl Debug for TaskConfigManager
Auto Trait Implementations§
impl Freeze for TaskConfigManager
impl RefUnwindSafe for TaskConfigManager
impl Send for TaskConfigManager
impl Sync for TaskConfigManager
impl Unpin for TaskConfigManager
impl UnwindSafe for TaskConfigManager
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