1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
pub trait License {
fn notice(&self, year: i32, name: &str, project: &str) -> String;
}
pub struct AGPL {}
impl License for AGPL {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/agpl-3.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct Apache {}
impl License for Apache {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/apache-2.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct BSD {}
impl License for BSD {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/bsd-3.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct CcBy {}
impl License for CcBy {
fn notice(&self, _year: i32, name: &str, project: &str) -> String {
format!(include_str!("../files/cc-by-4.0.txt"), AUTHOR = name, PROJECT = project)
}
}
pub struct CcByNc {}
impl License for CcByNc {
fn notice(&self, _year: i32, name: &str, project: &str) -> String {
format!(include_str!("../files/cc-by-nc-4.0.txt"), AUTHOR = name, PROJECT = project)
}
}
pub struct CcByNcSa {}
impl License for CcByNcSa {
fn notice(&self, _year: i32, name: &str, project: &str) -> String {
format!(include_str!("../files/cc-by-nc-sa-4.0.txt"), AUTHOR = name, PROJECT = project)
}
}
pub struct CcBySa {}
impl License for CcBySa {
fn notice(&self, _year: i32, name: &str, project: &str) -> String {
format!(include_str!("../files/cc-by-sa-4.0.txt"), AUTHOR = name, PROJECT = project)
}
}
pub struct CCZero {}
impl License for CCZero {
fn notice(&self, _year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/cc-zero-1.0.txt"), AUTHOR = name)
}
}
pub struct GPL {}
impl License for GPL {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/gpl-3.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct LGPL {}
impl License for LGPL {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/lgpl-3.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct Mit {}
impl License for Mit {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/mit.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct MPL {}
impl License for MPL {
fn notice(&self, year: i32, name: &str, _project: &str) -> String {
format!(include_str!("../files/mpl-2.0.txt"), YEAR = year, AUTHOR = name)
}
}
pub struct UNLICENSE {}
impl License for UNLICENSE {
fn notice(&self, _year: i32, _name: &str, _project: &str) -> String {
include_str!("../files/unlicense.txt").to_string()
}
}