[−][src]Trait guppy::graph::feature::FeatureFilter
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]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
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.
Trait Implementations
impl<'g, 'a> FeatureFilter<'g> for &'a mut dyn FeatureFilter<'g>
[src]
pub fn accept(
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
[src]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
Implementations on Foreign Types
impl<'g, 'a, T> FeatureFilter<'g> for &'a mut T where
T: FeatureFilter<'g>,
[src]
T: FeatureFilter<'g>,
pub fn accept(
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
[src]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
impl<'g, 'a> FeatureFilter<'g> for Box<dyn FeatureFilter<'g> + 'a>
[src]
pub fn accept(
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
[src]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
Implementors
impl<'g, 'a> FeatureFilter<'g> for &'a mut dyn FeatureFilter<'g>
[src]
pub fn accept(
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
[src]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
impl<'g, F> FeatureFilter<'g> for FeatureFilterFn<F> where
F: FnMut(&FeatureGraph<'g>, FeatureId<'g>) -> bool,
[src]
F: FnMut(&FeatureGraph<'g>, FeatureId<'g>) -> bool,
pub fn accept(
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool
[src]
&mut self,
graph: &FeatureGraph<'g>,
feature_id: FeatureId<'g>
) -> bool