[][src]Struct bindle::filters::BindleFilter

pub struct BindleFilter { /* fields omitted */ }

BindleFilter walks an invoice and resolves a list of parcels.

A bindle may define many parcels, some of which are to be included by default, and others which are members of groups that are only conditionally included. Parcels also have features attached to them. A feature can be turned on or off, and this will impact which list of parcels are considered the correct ones to pass on to the runtime.

The filter can be used to retrieve the list of parcels that satisfies a set of requirements. For example, use this to activate or deactivate features. You can also include or exclude groups.

Implementations

impl BindleFilter[src]

pub fn new(invoice: Invoice) -> Self[src]

pub fn with_group(&mut self, group_name: &str) -> &mut Self[src]

Explicitly enable the given group.

Note that some groups may be enabled in virtue of a requirement condition (e.g. a parcel requires a group). This has no impact for that condition.

pub fn without_group(&mut self, group_name: &str) -> &mut Self[src]

Explicitly disable the given group.

Note that some groups may be enabled in virtue of a requirement condition (e.g. a parcel requires a group). This function will not override a require condition on a parcel, as doing so will break the entire requirement chain for the list. However, it will remove a group whose required field is set to true.

pub fn activate_feature(
    &mut self,
    group: &str,
    name: &str,
    value: &str
) -> &mut Self
[src]

Activate a feature by group, name, and value.

This corresponds to the TOML:

[parcel.label.feature.GROUP] NAME = "VALUE"

This will mark parcels with this feature as "activated", meaning they will be returned in the filter result if something else does not remove them.

pub fn deactivate_feature(
    &mut self,
    group: &str,
    name: &str,
    value: &str
) -> &mut Self
[src]

Deactivate a feature by group, name, and value.

This corresponds to the TOML:

[parcel.label.feature.GROUP] NAME = "VALUE"

If a feature is activated and deactivated in the same builder, it will be considered deactivated.

pub fn filter(&self) -> Vec<Parcel>[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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

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