[][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

Implementations

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 Clone for Template[src]

impl Copy for Template[src]

impl Debug for Template[src]

impl Display for Template[src]

impl FromStr for Template[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<Template> for Template[src]

impl StructuralPartialEq for Template[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.