Struct json_gettext::JSONGetText [−][src]
pub struct JSONGetText<'a> { /* fields omitted */ }
A wrapper for context and a default key. Keys are usually considered as locales.
Methods
impl<'a> JSONGetText<'a>
[src]
impl<'a> JSONGetText<'a>
pub fn build(default_key: &str) -> JSONGetTextBuilder
[src]
pub fn build(default_key: &str) -> JSONGetTextBuilder
Create a new JSONGetTextBuilder instance. You need to decide your default key at the stage.
pub fn from_context(
default_key: &str,
context: HashMap<String, HashMap<String, Value<'a>>>
) -> Result<JSONGetText<'a>, String>
[src]
pub fn from_context(
default_key: &str,
context: HashMap<String, HashMap<String, Value<'a>>>
) -> Result<JSONGetText<'a>, String>
Create a new JSONGetText instance with context and a default key.
pub fn get_keys(&self) -> Vec<&str>
[src]
pub fn get_keys(&self) -> Vec<&str>
Get all keys in context.
pub fn get_default_key(&self) -> &str
[src]
pub fn get_default_key(&self) -> &str
Get the default key.
pub fn get(&self, key: &str) -> &HashMap<String, Value>
[src]
pub fn get(&self, key: &str) -> &HashMap<String, Value>
Get a string map from context by a key.
pub fn get_text(&self, text: &str) -> Option<Value>
[src]
pub fn get_text(&self, text: &str) -> Option<Value>
Get text from context.
pub fn get_text_with_key(&self, key: &str, text: &str) -> Option<Value>
[src]
pub fn get_text_with_key(&self, key: &str, text: &str) -> Option<Value>
Get text from context with a specific key.
pub fn get_filtered_text(&self, regex: &Regex) -> Option<HashMap<&str, Value>>
[src]
pub fn get_filtered_text(&self, regex: &Regex) -> Option<HashMap<&str, Value>>
Get filtered text from context by a Regex instance. The output map is usually used for serialization.
pub fn get_filtered_text_with_key(
&self,
key: &str,
regex: &Regex
) -> Option<HashMap<&str, Value>>
[src]
pub fn get_filtered_text_with_key(
&self,
key: &str,
regex: &Regex
) -> Option<HashMap<&str, Value>>
Get filtered text from context with a specific key by a Regex instance. The output map is usually used for serialization.
Trait Implementations
impl<'a> Debug for JSONGetText<'a>
[src]
impl<'a> Debug for JSONGetText<'a>
Auto Trait Implementations
impl<'a> Send for JSONGetText<'a>
impl<'a> Send for JSONGetText<'a>
impl<'a> Sync for JSONGetText<'a>
impl<'a> Sync for JSONGetText<'a>