llvm_cov_json/types/
function.rs

1use serde::Deserialize;
2
3use crate::{Branch, Region};
4
5
6/// Metrics relate to one specific function.
7#[derive(Debug, PartialEq, Deserialize)]
8pub struct FunctionMetrics<'a> {
9    /// Absolute file paths indexed via the file ids in `branches` and `regions` attribute.
10    pub filenames: Vec<&'a str>,
11    /// Source code level branches in this function. File ids of the branches are indices into
12    /// the `filenames` array.
13    pub branches: Vec<Branch>,
14    /// Number of times this function was called.
15    pub count: u64,
16    /// Name of the function.
17    pub name: &'a str,
18    /// The regions in this function. File ids of the regions are indices into
19    /// the `filenames` array.
20    pub regions: Vec<Region>,
21}