Skip to main content

provenant/license_detection/models/
license.rs

1// SPDX-FileCopyrightText: nexB Inc. and others
2// ScanCode is a trademark of nexB Inc.
3// SPDX-FileCopyrightText: Provenant contributors
4// SPDX-License-Identifier: Apache-2.0
5// Derived from ScanCode Toolkit (Apache-2.0); modified. See NOTICE.
6
7//! License metadata loaded from .LICENSE files.
8
9use rkyv::Archive;
10use serde::{Deserialize, Serialize};
11
12/// License metadata loaded from .LICENSE files.
13#[derive(
14    Debug,
15    Clone,
16    PartialEq,
17    Default,
18    Serialize,
19    Deserialize,
20    Archive,
21    rkyv::Serialize,
22    rkyv::Deserialize,
23)]
24pub struct License {
25    pub key: String,
26    pub short_name: Option<String>,
27    pub name: String,
28    pub language: Option<String>,
29    pub spdx_license_key: Option<String>,
30    pub other_spdx_license_keys: Vec<String>,
31    pub category: Option<String>,
32    pub owner: Option<String>,
33    pub homepage_url: Option<String>,
34    pub text: String,
35    pub reference_urls: Vec<String>,
36    pub osi_license_key: Option<String>,
37    pub text_urls: Vec<String>,
38    pub osi_url: Option<String>,
39    pub faq_url: Option<String>,
40    pub other_urls: Vec<String>,
41    pub notes: Option<String>,
42    pub is_deprecated: bool,
43    pub is_exception: bool,
44    pub is_unknown: bool,
45    pub is_generic: bool,
46    pub replaced_by: Vec<String>,
47    pub minimum_coverage: Option<u8>,
48    pub standard_notice: Option<String>,
49    pub ignorable_copyrights: Option<Vec<String>>,
50    pub ignorable_holders: Option<Vec<String>>,
51    pub ignorable_authors: Option<Vec<String>>,
52    pub ignorable_urls: Option<Vec<String>>,
53    pub ignorable_emails: Option<Vec<String>>,
54}