dry4rust/output/report.rs
1// Copyright (c) 2026 Matjaz Domen Pecan
2// Copyright 2026 Umberto Gotti <umberto.gotti@umbertogotti.dev>
3// Licensed under the MIT License
4// SPDX-License-Identifier: MIT
5
6use crate::grouper::{DuplicateGroup, DuplicationStats};
7
8/// Everything a full report shows, handed to a reporter in one piece.
9///
10/// It exists because the shape of the document is the format's business and
11/// not the command's. Text can be written a section at a time and read
12/// correctly; JSON cannot, and a caller that emitted one section per call
13/// produced several top-level documents rather than one.
14pub struct Report<'a> {
15 pub stats: &'a DuplicationStats,
16 pub exact: &'a [DuplicateGroup],
17 pub near: &'a [DuplicateGroup],
18 pub sub_exact: &'a [DuplicateGroup],
19 pub sub_near: &'a [DuplicateGroup],
20}