pub trait NetworkRepositoryTrait: 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, Network>, RepositoryError>> + Send + 'async_trait>>
where 'life0: 'async_trait;
fn get(&self, network_id: &str) -> Option<Network>;
fn get_all(&self) -> HashMap<String, Network>;
}
Expand description
Interface for network repository implementations
This trait defines the standard operations that any network 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 repository instance
Sourcefn load_all<'life0, 'async_trait>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Network>, 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, Network>, RepositoryError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Load all network 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.