Trait ReportFormatter

Source
pub trait ReportFormatter<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> {
    type Output;

    // Required methods
    fn format_external(&self, external: &External<P, VS, M>) -> Self::Output;
    fn format_terms(&self, terms: &Map<P, Term<VS>>) -> Self::Output;
    fn explain_both_external(
        &self,
        external1: &External<P, VS, M>,
        external2: &External<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
    fn explain_both_ref(
        &self,
        ref_id1: usize,
        derived1: &Derived<P, VS, M>,
        ref_id2: usize,
        derived2: &Derived<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
    fn explain_ref_and_external(
        &self,
        ref_id: usize,
        derived: &Derived<P, VS, M>,
        external: &External<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
    fn and_explain_external(
        &self,
        external: &External<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
    fn and_explain_ref(
        &self,
        ref_id: usize,
        derived: &Derived<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
    fn and_explain_prior_and_external(
        &self,
        prior_external: &External<P, VS, M>,
        external: &External<P, VS, M>,
        current_terms: &Map<P, Term<VS>>,
    ) -> Self::Output;
}
Expand description

Trait for formatting outputs in the reporter.

Required Associated Types§

Source

type Output

Output type of the report.

Required Methods§

Source

fn format_external(&self, external: &External<P, VS, M>) -> Self::Output

Format an External incompatibility.

Source

fn format_terms(&self, terms: &Map<P, Term<VS>>) -> Self::Output

Format terms of an incompatibility.

Source

fn explain_both_external( &self, external1: &External<P, VS, M>, external2: &External<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

Simplest case, we just combine two external incompatibilities.

Source

fn explain_both_ref( &self, ref_id1: usize, derived1: &Derived<P, VS, M>, ref_id2: usize, derived2: &Derived<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

Both causes have already been explained so we use their refs.

Source

fn explain_ref_and_external( &self, ref_id: usize, derived: &Derived<P, VS, M>, external: &External<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

One cause is derived (already explained so one-line), the other is a one-line external cause, and finally we conclude with the current incompatibility.

Source

fn and_explain_external( &self, external: &External<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

Add an external cause to the chain of explanations.

Source

fn and_explain_ref( &self, ref_id: usize, derived: &Derived<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

Add an already explained incompat to the chain of explanations.

Source

fn and_explain_prior_and_external( &self, prior_external: &External<P, VS, M>, external: &External<P, VS, M>, current_terms: &Map<P, Term<VS>>, ) -> Self::Output

Add an already explained incompat to the chain of explanations.

Implementors§