Skip to main content

dump_root

Function dump_root 

Source
pub fn dump_root(space: &FuncSpace) -> Result<()>
Expand description

Dumps the metrics of a code.

Returns a Result value, when an error occurs.

§Errors

Propagates any std::io::Error produced by the color-aware writer that backs stdout (broken pipe, write failure, …).

§Examples

use big_code_analysis::{analyze, dump_root, LANG, MetricsOptions, Source};

// Compute metrics via the non-generic `analyze` entry point.
let space = analyze(
    Source::new(LANG::Cpp, b"int a = 42;"),
    MetricsOptions::default(),
)
.expect("snippet has a top-level FuncSpace");

// Dump all metrics
dump_root(&space).unwrap();