Enum subgraph::json::Value

source ยท
pub enum Value {
    Null,
    Bool(bool),
    Number(Number),
    String(String),
    Array(Vec<Value>),
    Object(IndexMap<String, Value>),
}
Expand description

A Subgraph JSON value.

Variantsยง

Implementationsยง

Parses a new JSON from from some bytes.

Parses a new JSON value from bytes, returning and error on failure.

Returns the JSON value as a unit value, or None if the value is not null.

Returns the JSON value as a boolean value, or None if the value is not true or false.

Returns the JSON value as a numeric value, or None if the value is not a number.

Returns the JSON value as a string value, or None if the value is not a string.

Returns the JSON value as a slice of values, or None if the value is not an array.

Returns the JSON value as a map of values, or None if the value is not an object.

Trait Implementationsยง

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the โ€œdefault valueโ€ for a type. Read more
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementationsยง

Blanket Implementationsยง

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.