pub struct TriggerRegistry { /* private fields */ }Expand description
Registry for mapping task type names to their corresponding operations
Implementations§
Source§impl TriggerRegistry
impl TriggerRegistry
Sourcepub fn set<T>(&mut self, factory: T) -> OpResult<()>
pub fn set<T>(&mut self, factory: T) -> OpResult<()>
Set a trigger with its corresponding operation factory
Sourcepub fn spawn(&self, trigger_name: &str) -> Result<Box<dyn Trigger>, String>
pub fn spawn(&self, trigger_name: &str) -> Result<Box<dyn Trigger>, String>
Create a Trigger instance for a trigger type
Sourcepub fn list_names(&self) -> Vec<String>
pub fn list_names(&self) -> Vec<String>
Get all set triggers
pub fn list(&self) -> Vec<String>
Sourcepub fn unregister(&mut self, trigger_name: &str) -> bool
pub fn unregister(&mut self, trigger_name: &str) -> bool
Remove a set trigger
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TriggerRegistry
impl !UnwindSafe for TriggerRegistry
impl Freeze for TriggerRegistry
impl Send for TriggerRegistry
impl Sync for TriggerRegistry
impl Unpin for TriggerRegistry
impl UnsafeUnpin for TriggerRegistry
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