Struct tusk_rs::json::JsonObject
source · pub struct JsonObject { /* private fields */ }
Expand description
A JSON structure that is formatted like the following:
{ “key”: “value” }
Implementations§
source§impl JsonObject
impl JsonObject
sourcepub fn empty() -> JsonObject
pub fn empty() -> JsonObject
Creates an empty JSON object. This is useful for building a JSON object from scratch.
sourcepub fn from_string(json: &str) -> JsonObject
pub fn from_string(json: &str) -> JsonObject
Builds a JSONObject from a string containing keys and values.
§Arguments
json
— An owned string containing the JSON.
sourcepub fn get<T: JsonRetrieve>(&self, key: &str) -> Result<T, JsonParseError>
pub fn get<T: JsonRetrieve>(&self, key: &str) -> Result<T, JsonParseError>
Return a key of the JSON object as a type which implements JsonRetrieve.
§Arguments
key
— The key to retrieve from.
Trait Implementations§
source§impl Debug for JsonObject
impl Debug for JsonObject
source§impl Default for JsonObject
impl Default for JsonObject
source§impl JsonRetrieve for JsonObject
impl JsonRetrieve for JsonObject
Auto Trait Implementations§
impl Freeze for JsonObject
impl RefUnwindSafe for JsonObject
impl Send for JsonObject
impl Sync for JsonObject
impl Unpin for JsonObject
impl UnwindSafe for JsonObject
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