[][src]Struct cargo_create::config::template::Feature

pub struct Feature<'a> {
    pub name: &'a str,
    pub files: Option<Vec<&'a str>>,
    pub include: Option<Vec<&'a str>>,
}

A template feature.

Fields

name: &'a str

The name of the feature. Has to be unique inside a repository.

files: Option<Vec<&'a str>>

The files that get included and processed if the feature is being used.

include: Option<Vec<&'a str>>

Features that should get included if this one is being used.

Implementations

impl<'a> Feature<'a>[src]

pub fn files_to_include(&self) -> Vec<&'a str>[src]

Returns all files to include with this feature.

This does merge all files plus the files that get included from all other workflows.

pub fn get_features_for_feature<'b>(
    &'b self,
    all_features: &'b [&'b Feature<'b>]
) -> Cow<'b, [&'b Feature<'b>]>
[src]

Returns a list of features that are part of a feature.

Features including other features via the include keywords are called super-features.

Arguments

  • all_features: A slice of all features that have been defined.

Trait Implementations

impl<'a> Clone for Feature<'a>[src]

impl<'a> Debug for Feature<'a>[src]

impl<'a> Default for Feature<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for Feature<'a>[src]

impl<'a> Eq for Feature<'a>[src]

impl<'a> PartialEq<Feature<'a>> for Feature<'a>[src]

impl<'a> StructuralEq for Feature<'a>[src]

impl<'a> StructuralPartialEq for Feature<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Feature<'a>

impl<'a> Send for Feature<'a>

impl<'a> Sync for Feature<'a>

impl<'a> Unpin for Feature<'a>

impl<'a> UnwindSafe for Feature<'a>

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,