pub enum Template {
Apache2,
Gpl3,
Mit,
Wxs,
}
Expand description
The different templates that can be printed or written to a file.
Variants§
Apache2
The Apache-2.0 license.
Gpl3
The GPL-3.0 license.
Mit
The MIT license.
Wxs
A WiX Source (wxs) file.
Implementations§
source§impl Template
impl Template
sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
Gets the ID for the template.
In the case of a license template, the ID is the SPDX ID which is also used for the
license
field in the package’s manifest (Cargo.toml). This is also the same value used
with the cargo wix print
subcommand.
Examples
use wix::Template;
assert_eq!(Template::Apache2.id(), "Apache-2.0");
assert_eq!(Template::Gpl3.id(), "GPL-3.0");
assert_eq!(Template::Mit.id(), "MIT");
assert_eq!(Template::Wxs.id(), "WXS");
sourcepub fn possible_values() -> &'static Vec<String>
pub fn possible_values() -> &'static Vec<String>
Gets the possible string representations of each variant.
The possibilities are combination of case (upper and lower) for the various templates that are available.
Examples
use wix::Template;
assert_eq!(
Template::possible_values(),
&vec![
"Apache-2.0".to_owned(),
"apache-2.0".to_owned(),
"GPL-3.0".to_owned(),
"gpl-3.0".to_owned(),
"MIT".to_owned(),
"mit".to_owned(),
"WXS".to_owned(),
"wxs".to_owned()
]
);
sourcepub fn license_ids() -> Vec<String>
pub fn license_ids() -> Vec<String>
Gets the IDs of all supported licenses.
Examples
use wix::Template;
assert_eq!(
Template::license_ids(),
vec![
"Apache-2.0".to_owned(),
"GPL-3.0".to_owned(),
"MIT".to_owned(),
]
);