pub fn map_variables_to_segments<M>(mut self, mapper: M) -> Self
    where
        M: Fn(&str) -> Option<Result<Vec<Segment>, StringFormatterError>> + Sync,
    {
        self.variables
            .par_iter_mut()
            .filter(|(_, value)| value.is_none())
            .for_each(|(key, value)| {
                *value = mapper(key).map(|var| var.map(VariableValue::Styled));
            });
        self
    }
/// Maps variable name to an array of segments
///
/// See `StringFormatter::map` for description on the parameters.
Maps variable name to an array of segments
See `StringFormatter::map` for description on the parameters.
Maps variable name to an array of segments See ` StringFormatter :: map ` for description on the parameters .
pub fn map_variables_to_segments<M>(mut self, mapper: M) -> Self
    where
        M: Fn(&str) -> Option<Result<Vec<Segment>, StringFormatterError>> + Sync,
    {
        self.variables
            .par_iter_mut()
            .filter(|(_, value)| value.is_none())
            .for_each(|(key, value)| {
                *value = mapper(key).map(|var| var.map(VariableValue::Styled));
            });
        self
    }
pub fn map_variables_to_segments < M > ( mut self , mapper : M ) -> Self where M : Fn ( & str ) -> Option < Result < Vec < Segment > , StringFormatterError > > + Sync , { self . variables . par_iter_mut ( ) . filter ( | ( _ , value ) | value . is_none ( ) ) . for_each ( | ( key , value ) | { * value = mapper ( key ) . map ( | var | var . map ( VariableValue :: Styled ) ) ; } ) ; self }
Maps variable name to an array of segments
See `StringFormatter::map` for description on the parameters.
Maps variable name to an array of segments See ` StringFormatter :: map ` for description on the parameters .
mut self
mapper
M