Skip to main content

ChangeRepository

Trait ChangeRepository 

Source
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§

Source

fn resolve_target_with_options( &self, input: &str, options: ResolveTargetOptions, ) -> ChangeTargetResolution

Resolve an input change target into a canonical change id using options.

Source

fn suggest_targets(&self, input: &str, max: usize) -> Vec<String>

Return best-effort suggestions for a change target.

Source

fn exists(&self, id: &str) -> bool

Check if a change exists.

Source

fn get(&self, id: &str) -> Result<Change, DomainError>

Get a full change with all artifacts loaded.

Source

fn list(&self) -> Result<Vec<ChangeSummary>, DomainError>

List all changes as summaries (lightweight).

Source

fn list_by_module( &self, module_id: &str, ) -> Result<Vec<ChangeSummary>, DomainError>

List changes belonging to a specific module.

Source

fn list_incomplete(&self) -> Result<Vec<ChangeSummary>, DomainError>

List changes with incomplete tasks.

Source

fn list_complete(&self) -> Result<Vec<ChangeSummary>, DomainError>

List changes with all tasks complete.

Source

fn get_summary(&self, id: &str) -> Result<ChangeSummary, DomainError>

Get a summary for a specific change (lightweight).

Provided Methods§

Source

fn resolve_target(&self, input: &str) -> ChangeTargetResolution

Resolve an input change target into a canonical change id.

Implementors§