[][src]Enum wix::Template

pub enum Template {
    Apache2,
    Gpl3,
    Mit,
    Wxs,
}

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

Methods

impl Template[src]

pub fn id(&self) -> &str[src]

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

extern crate wix;

use wix::Template;

fn main() {
    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");
}

pub fn possible_values() -> Vec<String>[src]

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

extern crate wix;

use wix::Template;

fn main() {
    assert_eq!(
        Template::possible_values(),
        vec![
            "Apache-2.0",
            "apache-2.0",
            "GPL-3.0",
            "gpl-3.0",
            "MIT",
            "mit",
            "WXS",
            "wxs"
        ]
    );
}

pub fn license_ids() -> Vec<String>[src]

Gets the IDs of all supported licenses.

Examples

extern crate wix;

use wix::Template;

fn main() {
    assert_eq!(
        Template::license_ids(),
        vec![
            "Apache-2.0",
            "GPL-3.0",
            "MIT",
        ]
    );
}

pub fn to_str(&self) -> &str[src]

Gets the embedded contents of the template as a string.

Trait Implementations

impl Copy for Template[src]

impl PartialEq<Template> for Template[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for Template[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Template[src]

impl Debug for Template[src]

impl FromStr for Template[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Template

impl Sync for Template

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]