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 JSONGetTextpub fn build(default_key: &str) -> JSONGetTextBuilder[src]
pub fn build(default_key: &str) -> JSONGetTextBuilderCreate 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>>
) -> Result<JSONGetText, String>[src]
pub fn from_context(
default_key: &str,
context: HashMap<String, HashMap<String, Value>>
) -> 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) -> &strGet 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 Debug for JSONGetText[src]
impl Debug for JSONGetTextAuto Trait Implementations
impl Send for JSONGetText
impl Send for JSONGetTextimpl Sync for JSONGetText
impl Sync for JSONGetText