pub fn map_meta<M>(mut self, mapper: M) -> Self
    where
        M: Fn(&str, &BTreeSet<String>) -> Option<&'a str> + Sync,
    {
        let variables = self.get_variables();
        let (variables, style_variables) = self
            .variables
            .iter_mut()
            .filter(|(_, value)| value.is_none())
            .fold(
                (VariableMapType::new(), StyleVariableMapType::new()),
                |(mut v, mut sv), (key, value)| {
                    *value = mapper(key, &variables).map(|format| {
                        StringFormatter::new(format).map(|formatter| {
                            let StringFormatter {
                                format,
                                mut variables,
                                mut style_variables,
                            } = formatter;

                            // Add variables in meta variables to self
                            v.append(&mut variables);
                            sv.append(&mut style_variables);

                            VariableValue::Meta(format)
                        })
                    });

                    (v, sv)
                },
            );

        self.variables.extend(variables);
        self.style_variables.extend(style_variables);

        self
    }
/// Maps a meta-variable to a format string containing other variables.
///
/// This function should be called **before** other map methods so that variables found in
/// the format strings of meta-variables can be cached properly.
///
/// See `StringFormatter::map` for description on the parameters.
Maps a meta-variable to a format string containing other variables.
This function should be called **before** other map methods so that variables found in
the format strings of meta-variables can be cached properly.

See `StringFormatter::map` for description on the parameters.
Maps a meta - variable to a format string containing other variables . This function should be called ** before ** other map methods so that variables found in the format strings of meta - variables can be cached properly . See ` StringFormatter :: map ` for description on the parameters .
pub fn map_meta<M>(mut self, mapper: M) -> Self
    where
        M: Fn(&str, &BTreeSet<String>) -> Option<&'a str> + Sync,
    {
        let variables = self.get_variables();
        let (variables, style_variables) = self
            .variables
            .iter_mut()
            .filter(|(_, value)| value.is_none())
            .fold(
                (VariableMapType::new(), StyleVariableMapType::new()),
                |(mut v, mut sv), (key, value)| {
                    *value = mapper(key, &variables).map(|format| {
                        StringFormatter::new(format).map(|formatter| {
                            let StringFormatter {
                                format,
                                mut variables,
                                mut style_variables,
                            } = formatter;
                            // Add variables in meta variables to self
                            v.append(&mut variables);
                            sv.append(&mut style_variables);
                            VariableValue::Meta(format)
                        })
                    });
                    (v, sv)
                },
            );
        self.variables.extend(variables);
        self.style_variables.extend(style_variables);
        self
    }
pub fn map_meta < M > ( mut self , mapper : M ) -> Self where M : Fn ( & str , & BTreeSet < String > ) -> Option < & ' a str > + Sync , { let variables = self . get_variables ( ) ; let ( variables , style_variables ) = self . variables . iter_mut ( ) . filter ( | ( _ , value ) | value . is_none ( ) ) . fold ( ( VariableMapType :: new ( ) , StyleVariableMapType :: new ( ) ) , | ( mut v , mut sv ) , ( key , value ) | { * value = mapper ( key , & variables ) . map ( | format | { StringFormatter :: new ( format ) . map ( | formatter | { let StringFormatter { format , mut variables , mut style_variables , } = formatter ; // Add variables in meta variables to self v . append ( & mut variables ) ; sv . append ( & mut style_variables ) ; VariableValue :: Meta ( format ) } ) } ) ; ( v , sv ) } , ) ; self . variables . extend ( variables ) ; self . style_variables . extend ( style_variables ) ; self }
Maps a meta-variable to a format string containing other variables.
Maps a meta - variable to a format string containing other variables .
mut self
mapper
M