pub struct JSONGetTextBuilder<'a> { /* private fields */ }
Expand description
To build a JSONGetText instance, this struct can help you do that step by step.
Implementations§
Source§impl<'a> JSONGetTextBuilder<'a>
impl<'a> JSONGetTextBuilder<'a>
Sourcepub fn new<S: Into<String>>(default_key: S) -> JSONGetTextBuilder<'a>
pub fn new<S: Into<String>>(default_key: S) -> JSONGetTextBuilder<'a>
Create a new JSONGetTextBuilder
instance. You need to decide your default key at the stage.
Sourcepub fn add_json<K: AsRef<str> + Into<String>, J: AsRef<str> + ?Sized>(
&mut self,
key: K,
json: &'a J,
) -> Result<&mut Self, JSONGetTextBuildError>
pub fn add_json<K: AsRef<str> + Into<String>, J: AsRef<str> + ?Sized>( &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).
Sourcepub fn add_json_owned<K: AsRef<str> + Into<String>, J: AsRef<str>>(
&mut self,
key: K,
json: J,
) -> Result<&mut Self, JSONGetTextBuildError>
pub fn add_json_owned<K: AsRef<str> + Into<String>, J: AsRef<str>>( &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).
Sourcepub fn add_json_file<K: AsRef<str> + Into<String>, P: AsRef<Path>>(
&mut self,
key: K,
path: P,
) -> Result<&mut Self, JSONGetTextBuildError>
pub fn add_json_file<K: AsRef<str> + Into<String>, P: AsRef<Path>>( &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).
Sourcepub fn add_serialize<K: AsRef<str> + Into<String>, S: Serialize>(
&mut self,
key: K,
value: S,
) -> Result<&mut Self, JSONGetTextBuildError>
pub fn add_serialize<K: AsRef<str> + Into<String>, S: Serialize>( &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).
Sourcepub fn add_map<K: AsRef<str> + Into<String>>(
&mut self,
key: K,
map: HashMap<String, JSONGetTextValue<'a>>,
) -> Result<&mut Self, JSONGetTextBuildError>
pub fn add_map<K: AsRef<str> + Into<String>>( &mut self, key: K, map: HashMap<String, JSONGetTextValue<'a>>, ) -> Result<&mut Self, JSONGetTextBuildError>
Add a map to the context.
Sourcepub fn build(self) -> Result<JSONGetText<'a>, JSONGetTextBuildError>
pub fn build(self) -> Result<JSONGetText<'a>, JSONGetTextBuildError>
Build a JSONGetText
instance.
Trait Implementations§
Source§impl<'a> Clone for JSONGetTextBuilder<'a>
impl<'a> Clone for JSONGetTextBuilder<'a>
Source§fn clone(&self) -> JSONGetTextBuilder<'a>
fn clone(&self) -> JSONGetTextBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for JSONGetTextBuilder<'a>
impl<'a> Debug for JSONGetTextBuilder<'a>
Source§impl<'a> From<String> for JSONGetTextBuilder<'a>
impl<'a> From<String> for JSONGetTextBuilder<'a>
Source§fn from(v: String) -> JSONGetTextBuilder<'a>
fn from(v: String) -> JSONGetTextBuilder<'a>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for JSONGetTextBuilder<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more