git_scanner/
indicator_calculator.rs

1#![warn(clippy::all)]
2
3use failure::Error;
4use serde_json::Value;
5use std::path::Path;
6
7/// Wrapper for the logic that calculates toxicity indicators
8pub trait IndicatorCalculator: std::fmt::Debug {
9    fn name(&self) -> String;
10    fn calculate(&mut self, path: &Path) -> Result<Option<Value>, Error>;
11    /// root-level metadata - output after all files added
12    fn metadata(&self) -> Result<Option<Value>, Error>;
13}