[−][src]Enum json_ld::object::Object
Object.
JSON-LD connects together multiple kinds of data objects. Objects may be nodes, values or lists of objects.
Variants
Value(Value<T>)
Value object.
Node(Node<T>)
Node object.
List object.
Methods
impl<T: Id> Object<T>
[src]
pub fn id(&self) -> Option<&Lenient<Reference<T>>>
[src]
Identifier of the object, if it is a node object.
pub fn as_iri(&self) -> Option<Iri>
[src]
Identifier of the object as an IRI.
If the object is a node identified by an IRI, returns this IRI.
Returns None
otherwise.
pub fn is_value(&self) -> bool
[src]
Tests if the object is a value.
pub fn is_node(&self) -> bool
[src]
Tests if the object is a node.
pub fn is_graph(&self) -> bool
[src]
Tests if the object is a graph object (a node with a @graph
field).
pub fn is_list(&self) -> bool
[src]
Tests if the object is a list.
pub fn as_str(&self) -> Option<&str>
[src]
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.
pub fn into_unnamed_graph(
self: Indexed<Self>
) -> Result<HashSet<Indexed<Object<T>>>, Indexed<Self>>
[src]
self: Indexed<Self>
) -> Result<HashSet<Indexed<Object<T>>>, Indexed<Self>>
Try to convert this object into an unnamed graph.
Trait Implementations
impl<T: Id> AsJson for Object<T>
[src]
impl<T: Id> Debug for Object<T>
[src]
impl<T: Eq + Id> Eq for Object<T>
[src]
impl<T: Id> From<Node<T>> for Object<T>
[src]
impl<T: Id> From<Value<T>> for Object<T>
[src]
impl<T: Hash + Id> Hash for Object<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq + Id> PartialEq<Object<T>> for Object<T>
[src]
impl<T: Id> StructuralEq for Object<T>
[src]
impl<T: Id> StructuralPartialEq for Object<T>
[src]
impl<T: Id> TryFrom<Object<T>> for Node<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Object<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Object<T> where
T: Send,
T: Send,
impl<T> Sync for Object<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Object<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Object<T> where
T: UnwindSafe,
T: UnwindSafe,
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<T> ToOwned for T
[src]
type Owned = T
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>,