ito_domain/modules/repository.rs
1//! Module repository port definitions.
2
3use super::{Module, ModuleSummary};
4use crate::errors::DomainResult;
5
6/// Port for accessing module data.
7///
8/// Domain and adapters should depend on this interface rather than concrete
9/// storage details.
10pub trait ModuleRepository {
11 /// Check if a module exists.
12 fn exists(&self, id: &str) -> bool;
13
14 /// Get a module by ID or full name.
15 fn get(&self, id_or_name: &str) -> DomainResult<Module>;
16
17 /// List all modules.
18 fn list(&self) -> DomainResult<Vec<ModuleSummary>>;
19}