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(),
]
);Trait Implementations§
impl Copy for Template
impl Eq for Template
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more