[][src]Struct json_gettext::JSONGetText

pub struct JSONGetText<'a> { /* fields omitted */ }

A wrapper for context and a default key. Keys are usually considered as locales.

Implementations

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 get_keys(&self) -> Vec<&str>[src]

Get all keys in context.

pub fn contains_key<K: AsRef<str>>(&self, key: K) -> bool[src]

Returns true if the context contains a value for the specified key.

pub fn get_default_key(&self) -> &str[src]

Get the default key.

pub fn get<K: AsRef<str>>(
    &self,
    key: K
) -> &HashMap<String, JSONGetTextValue<'a>>
[src]

Get a string map from context by a key.

pub fn get_text<T: AsRef<str>>(
    &'a self,
    text: T
) -> Option<JSONGetTextValue<'a>>
[src]

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>>
[src]

Get text from context with a specific key.

pub fn get_multiple_text<'b, T: AsRef<str> + ?Sized>(
    &self,
    text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue>>
[src]

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: AsRef<str> + ?Sized>(
    &'a self,
    key: K,
    text_array: &[&'b T]
) -> Option<HashMap<&'b str, JSONGetTextValue<'a>>>
[src]

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<&str, JSONGetTextValue<'a>>>
[src]

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<&str, JSONGetTextValue<'a>>>
[src]

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]

Auto Trait Implementations

impl<'a> RefUnwindSafe for JSONGetText<'a>

impl<'a> Send for JSONGetText<'a>

impl<'a> Sync for JSONGetText<'a>

impl<'a> Unpin for JSONGetText<'a>

impl<'a> UnwindSafe for JSONGetText<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.