pub enum Object<J: JsonHash, T: Id = IriBuf> {
    Value(Value<J, T>),
    Node(Node<J, T>),
    List(Vec<Indexed<Self>>),
}
Expand description

Object.

JSON-LD connects together multiple kinds of data objects. Objects may be nodes, values or lists of objects.

Variants

Value(Value<J, T>)

Value object.

Node(Node<J, T>)

Node object.

List(Vec<Indexed<Self>>)

List object.

Implementations

Identifier of the object, if it is a node object.

Identifier of the object as an IRI.

If the object is a node identified by an IRI, returns this IRI. Returns None otherwise.

Tests if the object is a value.

Returns this object as a value, if it is one.

Converts this object as a value, if it is one.

Tests if the object is a node.

Returns this object as a node, if it is one.

Converts this object into a node, if it is one.

Tests if the object is a graph object (a node with a @graph field).

Tests if the object is a list.

Returns this object as a list, if it is one.

Converts this object into a list, if it is one.

Get the object as a string.

If the object is a value that is a string, returns this string. If the object is a node that is identified, returns the identifier as a string. Returns None otherwise.

Get the value as a boolean, if it is.

Get the value as a number, if it is.

If the objat is a language-tagged value, Return its associated language.

Trait Implementations

Converts this value into a K JSON value using the given meta function to convert J::MetaData into K::MetaData. Read more

Converts this value into a K JSON value. Read more

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

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

Compact with the given optional index.

Performs the conversion.

Performs the conversion.

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.