Formatter

Trait Formatter 

Source
pub trait Formatter {
    // Required methods
    fn format(&self, repo: &Repository, map: &RepoMap) -> String;
    fn format_repo(&self, repo: &Repository) -> String;
    fn name(&self) -> &'static str;
}
Expand description

Output formatter trait for in-memory formatting.

Use format() for formatting with a repository map (includes symbol rankings), or format_repo() for formatting just the repository files.

For large repositories, prefer the StreamingFormatter trait to reduce memory usage.

Required Methods§

Source

fn format(&self, repo: &Repository, map: &RepoMap) -> String

Format repository with map to string.

The output includes both the repository files and the symbol rankings from the repository map.

Source

fn format_repo(&self, repo: &Repository) -> String

Format repository only to string (without map metadata).

Source

fn name(&self) -> &'static str

Get format name.

Implementors§