/// Runs the provided `closure` with an iterator over the messages
/// available for the specified `language`. There may be duplicate
/// messages when they are duplicated in resources applicable to
/// the language. Returns the result of the closure.
Runs the provided `closure` with an iterator over the messages
available for the specified `language`. There may be duplicate
messages when they are duplicated in resources applicable to
the language. Returns the result of the closure.
Runs the provided ` closure ` with an iterator over the messages available for the specified ` language ` . There may be duplicate messages when they are duplicated in resources applicable to the language . Returns the result of the closure .
pub fn with_message_iter<OUT, C>(&self, language: &LanguageIdentifier, closure: C) -> OUT
    where
        C: Fn(&mut dyn Iterator<Item = &ast::Message<&str>>) -> OUT,
    {
        let config_lock = self.language_config.read();
        let mut iter = config_lock
            .language_bundles
            .iter()
            .filter(|language_bundle| &language_bundle.language == language)
            .flat_map(|language_bundle| {
                language_bundle.resources.iter().flat_map(|resource| {
                    let ast: &ast::Resource<&str> = resource.ast();
                    ast.body.iter().filter_map(|entry| match entry {
                        ast::Entry::Message(message) => Some(message),
                        _ => None,
                    })
                })
            });
        (closure)(&mut iter)
    }
pub fn with_message_iter < OUT , C > ( & self , language : & LanguageIdentifier , closure : C ) -> OUT where C : Fn ( & mut dyn Iterator < Item = & ast :: Message < & str > > ) -> OUT , { let config_lock = self . language_config . read ( ) ; let mut iter = config_lock . language_bundles . iter ( ) . filter ( | language_bundle | & language_bundle . language == language ) . flat_map ( | language_bundle | { language_bundle . resources . iter ( ) . flat_map ( | resource | { let ast : & ast :: Resource < & str > = resource . ast ( ) ; ast . body . iter ( ) . filter_map ( | entry | match entry { ast :: Entry :: Message ( message ) => Some ( message ) , _ => None , } ) } ) } ) ; ( closure ) ( & mut iter ) }
Runs the provided `closure` with an iterator over the messages
available for the specified `language`.
Runs the provided ` closure ` with an iterator over the messages available for the specified ` language ` .
&self
language
&LanguageIdentifier
closure
C