Skip to main content

treesearch/output/
mod.rs

1pub mod json;
2pub mod plain;
3pub mod tty;
4
5use crate::document::SearchResult;
6
7/// Trait for rendering search results in different output formats.
8pub trait OutputFormat {
9    /// Render search results to a string.
10    ///
11    /// `verbose` controls detail level:
12    ///   0 = minimal (title + score)
13    ///   1 = normal (title + summary + score)
14    ///   2 = full (title + summary + text + line numbers)
15    fn render(&self, results: &[SearchResult], verbose: u8) -> String;
16}