Expand description

Providers that filter resource requests.

Requests that fail a filter test will return DataError of kind FilteredResource and will not appear in IterableDynamicDataProvider iterators.

The main struct is RequestFilterDataProvider. Although that struct can be created directly, the traits in this module provide helper functions for common filtering patterns.

To create a RequestFilterDataProvider, you can use the Filterable blanket function:

use icu_provider_adapters::filter::Filterable;

// now call .filterable() on any object to get a RequestFilterDataProvider


use icu_locid::subtags_language as language;
use icu_provider::hello_world::*;
use icu_provider::prelude::*;
use icu_provider_adapters::filter::Filterable;

// Only return German data from a HelloWorldProvider:
    .filterable("Demo German-only filter")
    .filter_by_langid(|langid| langid.language == language!("de"));


A data provider that selectively filters out data requests.


A blanket-implemented trait exposing the Self::filterable() function.