scancode_rust/models/
output.rs

1use super::FileInfo;
2use serde::Serialize;
3
4pub const SCANCODE_OUTPUT_FORMAT_VERSION: &str = "4.0.0";
5
6#[derive(Serialize, Debug)]
7pub struct Output {
8    pub headers: Vec<Header>,
9    pub files: Vec<FileInfo>,
10    pub license_references: Vec<LicenseReference>,
11    pub license_rule_references: Vec<LicenseRuleReference>,
12}
13
14#[derive(Serialize, Debug)]
15pub struct Header {
16    pub start_timestamp: String,
17    pub end_timestamp: String,
18    pub duration: f64,
19    pub extra_data: ExtraData,
20    pub errors: Vec<String>,
21    pub output_format_version: String,
22}
23
24#[derive(Serialize, Debug)]
25pub struct ExtraData {
26    pub files_count: usize,
27    pub directories_count: usize,
28    pub excluded_count: usize,
29    pub system_environment: SystemEnvironment,
30}
31
32#[derive(Serialize, Debug)]
33pub struct SystemEnvironment {
34    pub operating_system: Option<String>,
35    pub cpu_architecture: String,
36    pub platform: String,
37    pub rust_version: String,
38}
39
40#[derive(Serialize, Debug)]
41pub struct LicenseReference {
42    pub name: String,
43    pub short_name: String,
44    pub spdx_license_key: String,
45    pub text: String,
46}
47
48#[derive(Serialize, Debug)]
49pub struct LicenseRuleReference {
50    pub identifier: String,
51    pub license_expression: String,
52    pub is_license_text: bool,
53    pub is_license_notice: bool,
54    pub is_license_reference: bool,
55    pub is_license_tag: bool,
56    pub is_license_clue: bool,
57    pub is_license_intro: bool,
58}