[−][src]Struct jsonc_parser::JsonObject
A JSON object.
Implementations
impl JsonObject
[src]
pub fn new(inner: HashMap<String, JsonValue>) -> JsonObject
[src]
Creates a new JsonObject.
pub fn take_inner(self) -> HashMap<String, JsonValue>
[src]
Drops the object returning the inner hash map.
pub fn len(&self) -> usize
[src]
Gets the number of properties.
pub fn get(&self, name: &str) -> Option<&JsonValue>
[src]
Gets a value in the object by its name.
pub fn get_string(&self, name: &str) -> Option<&String>
[src]
Gets a string property value from the object by name.
Returns None
when not a string or it doesn't exist.
pub fn get_number(&self, name: &str) -> Option<&String>
[src]
Gets a number property value from the object by name.
Returns None
when not a number or it doesn't exist.
pub fn get_boolean(&self, name: &str) -> Option<bool>
[src]
Gets a boolean property value from the object by name.
Returns None
when not a boolean or it doesn't exist.
pub fn get_object(&self, name: &str) -> Option<&JsonObject>
[src]
Gets an object property value from the object by name.
Returns None
when not an object or it doesn't exist.
pub fn get_array(&self, name: &str) -> Option<&JsonArray>
[src]
Gets an array property value from the object by name.
Returns None
when not an array or it doesn't exist.
pub fn take(&mut self, name: &str) -> Option<JsonValue>
[src]
Takes a value from the object by name.
Returns None
when it doesn't exist.
pub fn take_string(&mut self, name: &str) -> Option<String>
[src]
Takes a string property value from the object by name.
Returns None
when not a string or it doesn't exist.
pub fn take_number(&mut self, name: &str) -> Option<String>
[src]
Takes a number property value from the object by name.
Returns None
when not a number or it doesn't exist.
pub fn take_boolean(&mut self, name: &str) -> Option<bool>
[src]
Takes a boolean property value from the object by name.
Returns None
when not a boolean or it doesn't exist.
pub fn take_object(&mut self, name: &str) -> Option<JsonObject>
[src]
Takes an object property value from the object by name.
Returns None
when not an object or it doesn't exist.
pub fn take_array(&mut self, name: &str) -> Option<JsonArray>
[src]
Takes an array property value from the object by name.
Returns None
when not an array or it doesn't exist.
Trait Implementations
impl Clone for JsonObject
[src]
fn clone(&self) -> JsonObject
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for JsonObject
[src]
impl From<HashMap<String, JsonValue, RandomState>> for JsonObject
[src]
impl IntoIterator for JsonObject
[src]
type Item = (String, JsonValue)
The type of the elements being iterated over.
type IntoIter = IntoIter<String, JsonValue>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<JsonObject> for JsonObject
[src]
fn eq(&self, other: &JsonObject) -> bool
[src]
fn ne(&self, other: &JsonObject) -> bool
[src]
impl StructuralPartialEq for JsonObject
[src]
Auto Trait Implementations
impl RefUnwindSafe for JsonObject
impl Send for JsonObject
impl Sync for JsonObject
impl Unpin for JsonObject
impl UnwindSafe for JsonObject
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,
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<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,