[−][src]Struct json_gettext::JSONGetText
A wrapper for context and a default key. Keys are usually considered as locales.
Methods
impl<'a> JSONGetText<'a>
[src]
pub fn build<S: Into<String>>(default_key: S) -> JSONGetTextBuilder<'a>
[src]
Create a new JSONGetTextBuilder instance. You need to decide your default key at the stage.
pub fn build_with_default_key_str<S: AsRef<str>>(
default_key: S
) -> JSONGetTextBuilder<'a>
[src]
default_key: S
) -> JSONGetTextBuilder<'a>
please use build
instead
Create a new JSONGetTextBuilder instance. You need to decide your default key at the stage.
pub fn build_with_default_key_string(
default_key: String
) -> JSONGetTextBuilder<'a>
[src]
default_key: String
) -> JSONGetTextBuilder<'a>
please use build
instead
Create a new JSONGetTextBuilder instance. You need to decide your default key at the stage.
pub fn from_context_with_default_key<S: Into<String>>(
default_key: S,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
[src]
default_key: S,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
Create a new JSONGetText instance with context and a default key.
pub fn from_context_with_default_key_str<S: AsRef<str>>(
default_key: S,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
[src]
default_key: S,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
please use from_context_with_default_key
instead
Create a new JSONGetText instance with context and a default key.
pub fn from_context_with_default_key_string(
default_key: String,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
[src]
default_key: String,
context: HashMap<String, HashMap<String, JSONGetTextValue<'a>>>
) -> Result<JSONGetText<'a>, JSONGetTextError>
please use from_context_with_default_key
instead
Create a new JSONGetText instance with context and a default key.
pub fn get_keys(&self) -> Vec<&str>
[src]
Get all keys in context.
pub fn get_default_key(&self) -> &str
[src]
Get the default key.
pub fn get<K: AsRef<str>>(&self, key: K) -> &HashMap<String, JSONGetTextValue>
[src]
Get a string map from context by a key.
pub fn get_text<T: AsRef<str>>(&self, text: T) -> Option<JSONGetTextValue>
[src]
Get text from context.
pub fn get_text_with_key<K: AsRef<str>, T: AsRef<str>>(
&self,
key: K,
text: T
) -> Option<JSONGetTextValue>
[src]
&self,
key: K,
text: T
) -> Option<JSONGetTextValue>
Get text from context with a specific key.
pub fn get_multiple_text<'b, T: AsRef<str>>(
&self,
text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue>>
[src]
&self,
text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue>>
Get multiple text from context. The output map is usually used for serialization.
pub fn get_multiple_text_with_key<'b, K: AsRef<str>, T: ?Sized + AsRef<str>>(
&self,
key: K,
text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue>>
[src]
&self,
key: K,
text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue>>
Get multiple text from context with a specific key. The output map is usually used for serialization.
pub fn get_filtered_text(
&self,
regex: &Regex
) -> Option<HashMap<&str, JSONGetTextValue>>
[src]
&self,
regex: &Regex
) -> Option<HashMap<&str, JSONGetTextValue>>
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>>(
&self,
key: K,
regex: &Regex
) -> Option<HashMap<&str, JSONGetTextValue>>
[src]
&self,
key: K,
regex: &Regex
) -> Option<HashMap<&str, JSONGetTextValue>>
Get filtered text from context with a specific key by a Regex instance. The output map is usually used for serialization.
Trait Implementations
Auto Trait Implementations
impl<'a> Send for JSONGetText<'a>
impl<'a> Sync for JSONGetText<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,