[][src]Trait guppy::graph::feature::FeatureFilter

pub trait FeatureFilter<'g> {
    pub fn accept(
        &mut self,
        graph: &FeatureGraph<'g>,
        feature_id: FeatureId<'g>
    ) -> bool; }

Trait representing whether a feature within a package should be selected.

This is conceptually similar to passing --features or other similar command-line options to Cargo.

Most uses will involve using one of the predefined filters: all_filter, default_filter, or none_filter. A customized filter can be provided either through filter_fn or by implementing this trait.

Required methods

pub fn accept(
    &mut self,
    graph: &FeatureGraph<'g>,
    feature_id: FeatureId<'g>
) -> bool
[src]

Returns true if this feature ID should be selected in the graph.

Returning false does not prevent this feature ID from being included if it's reachable through other means.

In general, accept should return true if feature_id.is_base() is true.

The feature ID is guaranteed to be in this graph, so it is OK to panic if it isn't found.

Loading content...

Trait Implementations

impl<'g, 'a> FeatureFilter<'g> for &'a mut dyn FeatureFilter<'g>[src]

Implementations on Foreign Types

impl<'g, 'a, T> FeatureFilter<'g> for &'a mut T where
    T: FeatureFilter<'g>, 
[src]

impl<'g, 'a> FeatureFilter<'g> for Box<dyn FeatureFilter<'g> + 'a>[src]

Loading content...

Implementors

impl<'g, 'a> FeatureFilter<'g> for &'a mut dyn FeatureFilter<'g>[src]

impl<'g, F> FeatureFilter<'g> for FeatureFilterFn<F> where
    F: FnMut(&FeatureGraph<'g>, FeatureId<'g>) -> bool
[src]

Loading content...