pub trait TriggerRepositoryTrait: Clone {
// Required methods
fn new<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<Self, RepositoryError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
'life0: 'async_trait;
fn load_all<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Trigger>, RepositoryError>> + Send + 'async_trait>>
where 'life0: 'async_trait;
fn get(&self, trigger_id: &str) -> Option<Trigger>;
fn get_all(&self) -> HashMap<String, Trigger>;
}
Expand description
Interface for trigger repository implementations
This trait defines the standard operations that any trigger repository must support, allowing for different storage backends while maintaining a consistent interface.
Required Methods§
Sourcefn new<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<Self, RepositoryError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
fn new<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<Self, RepositoryError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
Create a new trigger repository from the given path
Sourcefn load_all<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Trigger>, RepositoryError>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn load_all<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Trigger>, RepositoryError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Load all trigger configurations from the given path
If no path is provided, uses the default config directory. This is a static method that doesn’t require an instance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.