[−][src]Struct bindle::filters::BindleFilter
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]
&mut self,
group: &str,
name: &str,
value: &str
) -> &mut Self
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]
&mut self,
group: &str,
name: &str,
value: &str
) -> &mut Self
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
impl RefUnwindSafe for BindleFilter
[src]
impl Send for BindleFilter
[src]
impl Sync for BindleFilter
[src]
impl Unpin for BindleFilter
[src]
impl UnwindSafe for BindleFilter
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,