Struct json_gettext::JSONGetText [−][src]
pub struct JSONGetText { /* fields omitted */ }
A wrapper for context and a default key. Keys are usually considered as locales.
Methods
impl JSONGetText
[src]
impl JSONGetText
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, String>>
) -> Result<JSONGetText, String>
[src]
pub fn from_context(
default_key: &str,
context: HashMap<String, HashMap<String, String>>
) -> Result<JSONGetText, 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, String>
[src]
pub fn get(&self, key: &str) -> &HashMap<String, String>
Get a string map from context by a key.
pub fn get_text(&self, text: &str) -> Option<&str>
[src]
pub fn get_text(&self, text: &str) -> Option<&str>
Get text from context.
pub fn get_text_with_key(&self, key: &str, text: &str) -> Option<&str>
[src]
pub fn get_text_with_key(&self, key: &str, text: &str) -> Option<&str>
Get text from context with a specific key.
pub fn get_filtered_text(&self, regex: &Regex) -> Option<HashMap<&str, &str>>
[src]
pub fn get_filtered_text(&self, regex: &Regex) -> Option<HashMap<&str, &str>>
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, &str>>
[src]
pub fn get_filtered_text_with_key(
&self,
key: &str,
regex: &Regex
) -> Option<HashMap<&str, &str>>
Get filtered text from context with a specific key by a Regex instance. The output map is usually used for serialization.
Trait Implementations
impl Debug for JSONGetText
[src]
impl Debug for JSONGetText
Auto Trait Implementations
impl Send for JSONGetText
impl Send for JSONGetText
impl Sync for JSONGetText
impl Sync for JSONGetText