Struct json_gettext::JSONGetText [−][src]
pub struct JSONGetText<'a> { /* fields omitted */ }
Expand description
A wrapper for context and a default key. Keys are usually considered as locales.
Implementations
Create a new JSONGetTextBuilder
instance. You need to decide your default key at the stage.
Returns true
if the context contains a value for the specified key.
Get the default key.
Get a string map from context by a key.
Get text from context.
pub fn get_text_with_key<K: AsRef<str>, T: AsRef<str>>(
&'a self,
key: K,
text: T
) -> Option<JSONGetTextValue<'a>>
pub fn get_text_with_key<K: AsRef<str>, T: AsRef<str>>(
&'a self,
key: K,
text: T
) -> Option<JSONGetTextValue<'a>>
Get text from context with a specific key.
Get multiple text from context. The output map is usually used for serialization.
Get multiple text from context with a specific key. The output map is usually used for serialization.
pub fn get_filtered_text(
&'a self,
regex: &Regex
) -> Option<HashMap<&'a str, JSONGetTextValue<'a>>>
pub fn get_filtered_text(
&'a self,
regex: &Regex
) -> Option<HashMap<&'a str, JSONGetTextValue<'a>>>
Get filtered text from context by a Regex instance. The output map is usually used for serialization.
pub fn get_filtered_text_with_key<K: AsRef<str>>(
&'a self,
key: K,
regex: &Regex
) -> Option<HashMap<&'a str, JSONGetTextValue<'a>>>
pub fn get_filtered_text_with_key<K: AsRef<str>>(
&'a self,
key: K,
regex: &Regex
) -> Option<HashMap<&'a str, JSONGetTextValue<'a>>>
Get filtered text from context with a specific key by a Regex instance. The output map is usually used for serialization.