pub fn new<F: FnMut(&str) -> Result<String>>(
        include_list: Option<String>,
        exclude_list: Option<String>,
        mut canonicalize: F,
    ) -> Result<Filter> {
        let (mut include, mut exclude) = (BTreeSet::new(), BTreeSet::new());
        if let Some(include_list) = include_list {
            for name in include_list.split(",") {
                include.insert(canonicalize(name.trim())?.to_string());
            }
        }
        if let Some(exclude_list) = exclude_list {
            for name in exclude_list.split(",") {
                exclude.insert(canonicalize(name.trim())?.to_string());
            }
        }
        Ok(Filter { include, exclude })
    }
/// Create a new include/exclude filter from the given lists.
///
/// Each list should be a comma separated list of property names (or
/// values), and they may be aliases. The canonicalization function given
/// should convert all such values into their canonical form.
Create a new include/exclude filter from the given lists.
Each list should be a comma separated list of property names (or
values), and they may be aliases. The canonicalization function given
should convert all such values into their canonical form.
Create a new include / exclude filter from the given lists . Each list should be a comma separated list of property names ( or values ) and they may be aliases . The canonicalization function given should convert all such values into their canonical form .
pub fn new<F: FnMut(&str) -> Result<String>>(
        include_list: Option<String>,
        exclude_list: Option<String>,
        mut canonicalize: F,
    ) -> Result<Filter> {
        let (mut include, mut exclude) = (BTreeSet::new(), BTreeSet::new());
        if let Some(include_list) = include_list {
            for name in include_list.split(",") {
                include.insert(canonicalize(name.trim())?.to_string());
            }
        }
        if let Some(exclude_list) = exclude_list {
            for name in exclude_list.split(",") {
                exclude.insert(canonicalize(name.trim())?.to_string());
            }
        }
        Ok(Filter { include, exclude })
    }
pub fn new < F : FnMut ( & str ) -> Result < String > > ( include_list : Option < String > , exclude_list : Option < String > , mut canonicalize : F , ) -> Result < Filter > { let ( mut include , mut exclude ) = ( BTreeSet :: new ( ) , BTreeSet :: new ( ) ) ; if let Some ( include_list ) = include_list { for name in include_list . split ( " " ) { include . insert ( canonicalize ( name . trim ( ) ) ? . to_string ( ) ) ; } } if let Some ( exclude_list ) = exclude_list { for name in exclude_list . split ( " " ) { exclude . insert ( canonicalize ( name . trim ( ) ) ? . to_string ( ) ) ; } } Ok ( Filter { include , exclude } ) }
Create a new include/exclude filter from the given lists.
Create a new include / exclude filter from the given lists .
include_list
Option<String>
exclude_list
Option<String>
canonicalize
F
include_list
Option<String>
exclude_list
Option<String>
canonicalize
F