Enum adventjson::JsonObject [−][src]
A json object
A full json object
Notes
In accordance to the specification a Number
may not be NaN
or one of
the Infinity
-ies, so it is Eq
and Ord
Variants
Array(Vec<Self>)
An array of objects (e.g.: [1,2,3])
Key-value pairs (e.g.: {"first": 10, "other": 15})
Number(f64)
A number (e.g.: -0.08333)
JsonStr(String)
A string (e.g.: "Test: \"")
Bool(bool)
A boolean (e.g. true)
The null-value
Implementations
impl JsonObject
[src]
pub fn partial_read(
s: &[char],
newindex: usize
) -> Result<(Self, usize), JsonError>
[src]
s: &[char],
newindex: usize
) -> Result<(Self, usize), JsonError>
Reads a json object partially
Reads a JsonObject
partially and returns both, it and where the
next character should be read.
Errors
Returns an JsonError
if the input was invalid.
pub fn read(s: &str) -> Result<Self, JsonError>
[src]
Reads a json object
Reads a JsonObject
or returns an error.
Errors
Returns an JsonError
if the input was invalid.
#[must_use]pub fn unique(&self) -> bool
[src]
Checks if all keys are unique
RFC 8259 requires all keys in objects (“{"one": 1, "twenty": 20}”) to be unique. This function checks recursively if that condition is met.
Trait Implementations
impl Clone for JsonObject
[src]
fn clone(&self) -> JsonObject
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for JsonObject
[src]
impl Default for JsonObject
[src]
fn default() -> Self
[src]
The default value is JsonObject::Null
impl Display for JsonObject
[src]
impl Eq for JsonObject
[src]
Save because no not-number values are allowed in json
impl Ord for JsonObject
[src]
Save because no not-number values are allowed in json
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<JsonObject> for JsonObject
[src]
fn eq(&self, other: &JsonObject) -> bool
[src]
fn ne(&self, other: &JsonObject) -> bool
[src]
impl PartialOrd<JsonObject> for JsonObject
[src]
fn partial_cmp(&self, other: &JsonObject) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,