Skip to main content

ObservableFeatures

Trait ObservableFeatures 

Source
pub trait ObservableFeatures {
    type Feature;

    // Required methods
    fn present_features(&self) -> impl Iterator<Item = &Self::Feature>;
    fn excluded_features(&self) -> impl Iterator<Item = &Self::Feature>;

    // Provided methods
    fn present_feature_count(&self) -> usize { ... }
    fn excluded_feature_count(&self) -> usize { ... }
}
Expand description

Common functionalities for containers of Observable features.

Required Associated Types§

Source

type Feature

The feature.

Required Methods§

Source

fn present_features(&self) -> impl Iterator<Item = &Self::Feature>

Get an iterator over features that were observed in the investigated item.

Source

fn excluded_features(&self) -> impl Iterator<Item = &Self::Feature>

Get an iterator over features whose presence was specifically excluded in the investigated item.

Provided Methods§

Source

fn present_feature_count(&self) -> usize

Get the number of observed features.

Source

fn excluded_feature_count(&self) -> usize

Get the number of features whose presence was specifically excluded.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, const N: usize> ObservableFeatures for [T; N]
where T: Observable,

Source§

type Feature = T

Source§

fn present_features(&self) -> impl Iterator<Item = &Self::Feature>

Source§

fn excluded_features(&self) -> impl Iterator<Item = &Self::Feature>

Source§

impl<T> ObservableFeatures for &[T]
where T: Observable,

Source§

type Feature = T

Source§

fn present_features(&self) -> impl Iterator<Item = &Self::Feature>

Source§

fn excluded_features(&self) -> impl Iterator<Item = &Self::Feature>

Source§

impl<T> ObservableFeatures for Vec<T>
where T: Observable,

Source§

type Feature = T

Source§

fn present_features(&self) -> impl Iterator<Item = &Self::Feature>

Source§

fn excluded_features(&self) -> impl Iterator<Item = &Self::Feature>

Implementors§