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 as an IRI.
If the object is a node identified by an IRI, returns this IRI.
Returns None
otherwise.
Converts this object as a value, if it is one.
Tests if the object is a graph object (a node with a @graph
field).
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.
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
Auto Trait Implementations
impl<J, T> RefUnwindSafe for Object<J, T> where
J: RefUnwindSafe,
T: RefUnwindSafe,
<J as Json>::Number: RefUnwindSafe,
<J as Json>::String: RefUnwindSafe,
impl<J, T> Send for Object<J, T> where
J: Send,
T: Send,
<J as Json>::Number: Send,
<J as Json>::String: Send,
impl<J, T> Sync for Object<J, T> where
J: Sync,
T: Sync,
<J as Json>::Number: Sync,
<J as Json>::String: Sync,
impl<J, T> Unpin for Object<J, T> where
J: Unpin,
T: Unpin,
<J as Json>::Number: Unpin,
<J as Json>::String: Unpin,
impl<J, T> UnwindSafe for Object<J, T> where
J: UnwindSafe,
T: UnwindSafe,
<J as Json>::Number: UnwindSafe,
<J as Json>::String: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn compact_indexed<'a, K, C, L, M>(
&'a Self,
Option<&'a str>,
Inversible<T, &'a C>,
Inversible<T, &'a C>,
Option<&'a str>,
&'a mut L,
Options,
M
) -> Pin<Box<dyn Future<Output = Result<K, Error>> + Send + 'a, Global>> where
K: JsonFrom<J>,
C: ContextMut<T> + Sync + Send,
L: Loader + Sync + Send,
J: 'a,
T: 'a,
M: 'a + Send + Sync + Clone + Fn(Option<&<J as Json>::MetaData>) -> <K as Json>::MetaData,
<C as Context<T>>::LocalContext: Send,
<C as Context<T>>::LocalContext: Sync,
<C as Context<T>>::LocalContext: From<<L as Loader>::Output>,
pub fn compact_indexed<'a, K, C, L, M>(
&'a Self,
Option<&'a str>,
Inversible<T, &'a C>,
Inversible<T, &'a C>,
Option<&'a str>,
&'a mut L,
Options,
M
) -> Pin<Box<dyn Future<Output = Result<K, Error>> + Send + 'a, Global>> where
K: JsonFrom<J>,
C: ContextMut<T> + Sync + Send,
L: Loader + Sync + Send,
J: 'a,
T: 'a,
M: 'a + Send + Sync + Clone + Fn(Option<&<J as Json>::MetaData>) -> <K as Json>::MetaData,
<C as Context<T>>::LocalContext: Send,
<C as Context<T>>::LocalContext: Sync,
<C as Context<T>>::LocalContext: From<<L as Loader>::Output>,
Compact with the given optional index.