Struct json_gettext::JSONGetTextBuilder [−][src]
To build a JSONGetText instance, this struct can help you do that step by step.
Implementations
impl<'a> JSONGetTextBuilder<'a>
[src]
pub fn new<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 add_json<K: AsRef<str> + Into<String>, J: AsRef<str> + ?Sized>(
&mut self,
key: K,
json: &'a J
) -> Result<&mut Self, JSONGetTextBuildError>
[src]
&mut self,
key: K,
json: &'a J
) -> Result<&mut Self, JSONGetTextBuildError>
Add a JSON string to the context for a specify key. The JSON string must represent a map object (key-value).
pub fn add_json_owned<K: AsRef<str> + Into<String>, J: AsRef<str>>(
&mut self,
key: K,
json: J
) -> Result<&mut Self, JSONGetTextBuildError>
[src]
&mut self,
key: K,
json: J
) -> Result<&mut Self, JSONGetTextBuildError>
Add a JSON string to the context for a specify key. The JSON string must represent a map object (key-value).
pub fn add_json_file<K: AsRef<str> + Into<String>, P: AsRef<Path>>(
&mut self,
key: K,
path: P
) -> Result<&mut Self, JSONGetTextBuildError>
[src]
&mut self,
key: K,
path: P
) -> Result<&mut Self, JSONGetTextBuildError>
Add a JSON file to the context for a specify key. The JSON file must represent a map object (key-value).
pub fn add_serialize<K: AsRef<str> + Into<String>, S: Serialize>(
&mut self,
key: K,
value: S
) -> Result<&mut Self, JSONGetTextBuildError>
[src]
&mut self,
key: K,
value: S
) -> Result<&mut Self, JSONGetTextBuildError>
Add any serializable value to the context for a specify key. The value must represent a map object (key-value).
pub fn add_map<K: AsRef<str> + Into<String>>(
&mut self,
key: K,
map: HashMap<String, JSONGetTextValue<'a>>
) -> Result<&mut Self, JSONGetTextBuildError>
[src]
&mut self,
key: K,
map: HashMap<String, JSONGetTextValue<'a>>
) -> Result<&mut Self, JSONGetTextBuildError>
Add a map to the context.
pub fn build(self) -> Result<JSONGetText<'a>, JSONGetTextBuildError>
[src]
Build a JSONGetText
instance.
Trait Implementations
impl<'a> Clone for JSONGetTextBuilder<'a>
[src]
fn clone(&self) -> JSONGetTextBuilder<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for JSONGetTextBuilder<'a>
[src]
impl<'a> From<String> for JSONGetTextBuilder<'a>
[src]
fn from(v: String) -> JSONGetTextBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for JSONGetTextBuilder<'a>
impl<'a> Send for JSONGetTextBuilder<'a>
impl<'a> Sync for JSONGetTextBuilder<'a>
impl<'a> Unpin for JSONGetTextBuilder<'a>
impl<'a> UnwindSafe for JSONGetTextBuilder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,