pub trait ChangeRepository {
// Required methods
fn resolve_target_with_options(
&self,
input: &str,
options: ResolveTargetOptions,
) -> ChangeTargetResolution;
fn suggest_targets(&self, input: &str, max: usize) -> Vec<String>;
fn exists(&self, id: &str) -> bool;
fn get(&self, id: &str) -> Result<Change, DomainError>;
fn list(&self) -> Result<Vec<ChangeSummary>, DomainError>;
fn list_by_module(
&self,
module_id: &str,
) -> Result<Vec<ChangeSummary>, DomainError>;
fn list_incomplete(&self) -> Result<Vec<ChangeSummary>, DomainError>;
fn list_complete(&self) -> Result<Vec<ChangeSummary>, DomainError>;
fn get_summary(&self, id: &str) -> Result<ChangeSummary, DomainError>;
// Provided method
fn resolve_target(&self, input: &str) -> ChangeTargetResolution { ... }
}Expand description
Port for accessing change data.
Domain and adapters should depend on this interface rather than concrete storage details.
Required Methods§
Sourcefn resolve_target_with_options(
&self,
input: &str,
options: ResolveTargetOptions,
) -> ChangeTargetResolution
fn resolve_target_with_options( &self, input: &str, options: ResolveTargetOptions, ) -> ChangeTargetResolution
Resolve an input change target into a canonical change id using options.
Sourcefn suggest_targets(&self, input: &str, max: usize) -> Vec<String>
fn suggest_targets(&self, input: &str, max: usize) -> Vec<String>
Return best-effort suggestions for a change target.
Sourcefn get(&self, id: &str) -> Result<Change, DomainError>
fn get(&self, id: &str) -> Result<Change, DomainError>
Get a full change with all artifacts loaded.
Sourcefn list(&self) -> Result<Vec<ChangeSummary>, DomainError>
fn list(&self) -> Result<Vec<ChangeSummary>, DomainError>
List all changes as summaries (lightweight).
Sourcefn list_by_module(
&self,
module_id: &str,
) -> Result<Vec<ChangeSummary>, DomainError>
fn list_by_module( &self, module_id: &str, ) -> Result<Vec<ChangeSummary>, DomainError>
List changes belonging to a specific module.
Sourcefn list_incomplete(&self) -> Result<Vec<ChangeSummary>, DomainError>
fn list_incomplete(&self) -> Result<Vec<ChangeSummary>, DomainError>
List changes with incomplete tasks.
Sourcefn list_complete(&self) -> Result<Vec<ChangeSummary>, DomainError>
fn list_complete(&self) -> Result<Vec<ChangeSummary>, DomainError>
List changes with all tasks complete.
Sourcefn get_summary(&self, id: &str) -> Result<ChangeSummary, DomainError>
fn get_summary(&self, id: &str) -> Result<ChangeSummary, DomainError>
Get a summary for a specific change (lightweight).
Provided Methods§
Sourcefn resolve_target(&self, input: &str) -> ChangeTargetResolution
fn resolve_target(&self, input: &str) -> ChangeTargetResolution
Resolve an input change target into a canonical change id.