pub struct TaskRegistry { /* private fields */ }Implementations§
Source§impl TaskRegistry
impl TaskRegistry
Sourcepub fn load(directory: impl AsRef<Path>) -> Result<Self, TaskError>
pub fn load(directory: impl AsRef<Path>) -> Result<Self, TaskError>
Loads tasks and migrates ownerless definitions to the designated legacy user.
pub fn validate_agents( &self, names: impl IntoIterator<Item = String>, ) -> Result<(), TaskError>
pub fn subscribe(&self) -> Receiver<u64>
pub fn snapshot(&self) -> Vec<Task>
Sourcepub fn migrate_owner(
&self,
old_user: &str,
new_user: &str,
) -> Result<(), TaskError>
pub fn migrate_owner( &self, old_user: &str, new_user: &str, ) -> Result<(), TaskError>
Migrates tasks created under a transport-specific owner to the stable user identity.
pub fn list(&self, user: &str) -> Vec<Task>
pub fn add(&self, user: &str, task: NewTask) -> Result<Task, TaskError>
Sourcepub fn update(
&self,
user: &str,
id: Uuid,
task: NewTask,
enabled: bool,
) -> Result<Task, TaskError>
pub fn update( &self, user: &str, id: Uuid, task: NewTask, enabled: bool, ) -> Result<Task, TaskError>
Replaces a task definition owned by the authenticated user.
Sourcepub fn set_enabled(
&self,
user: &str,
id: Uuid,
enabled: bool,
) -> Result<Task, TaskError>
pub fn set_enabled( &self, user: &str, id: Uuid, enabled: bool, ) -> Result<Task, TaskError>
Enables or disables a task without changing its definition.
pub fn remove(&self, user: &str, id: Uuid) -> Result<(), TaskError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TaskRegistry
impl !UnwindSafe for TaskRegistry
impl Freeze for TaskRegistry
impl Send for TaskRegistry
impl Sync for TaskRegistry
impl Unpin for TaskRegistry
impl UnsafeUnpin for TaskRegistry
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