pub struct Indexed<T> { /* private fields */ }Expand description
Indexed objects.
Nodes and value objects may be indexed by a string in JSON-LD. This type is a wrapper around any kind of indexable data.
It is a pointer type that Deref into the underlying value.
Implementations§
Source§impl<T> Indexed<T>
impl<T> Indexed<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Drops the index and returns the underlying value.
Sourcepub fn set_index(&mut self, index: Option<String>)
pub fn set_index(&mut self, index: Option<String>)
Sets the @index of the value, or removes it when given None.
Sourcepub fn into_parts(self) -> (T, Option<String>)
pub fn into_parts(self) -> (T, Option<String>)
Consumes the indexed value, returning the inner value and its
@index.
Source§impl<T, B> Indexed<Node<T, B>>
impl<T, B> Indexed<Node<T, B>>
Sourcepub fn entries(&self) -> IndexedEntries<'_, T, B> ⓘ
pub fn entries(&self) -> IndexedEntries<'_, T, B> ⓘ
Returns an iterator over the entries of the JSON representation of
the node, including its @index entry if any.
Source§impl<T: Eq + Hash, B: Eq + Hash> Indexed<Node<T, B>>
impl<T: Eq + Hash, B: Eq + Hash> Indexed<Node<T, B>>
Sourcepub fn equivalent(&self, other: &Self) -> bool
pub fn equivalent(&self, other: &Self) -> bool
Checks whether the two indexed nodes are equivalent: same @index
and equivalent inner nodes.
Source§impl<T: Eq + Hash, B: Eq + Hash> Indexed<Object<T, B>>
impl<T: Eq + Hash, B: Eq + Hash> Indexed<Object<T, B>>
Sourcepub fn equivalent(&self, other: &Self) -> bool
pub fn equivalent(&self, other: &Self) -> bool
Checks whether the two indexed objects are equivalent: same @index
and equivalent inner objects.
Source§impl<T, B> Indexed<Object<T, B>>
impl<T, B> Indexed<Object<T, B>>
Sourcepub fn into_indexed_node(self) -> Option<Indexed<Node<T, B>>>
pub fn into_indexed_node(self) -> Option<Indexed<Node<T, B>>>
Converts this indexed object into an indexed node, if it is one.
Sourcepub fn into_indexed_value(self) -> Option<Indexed<Value<T>>>
pub fn into_indexed_value(self) -> Option<Indexed<Value<T>>>
Converts this indexed object into an indexed value, if it is one.
Sourcepub fn into_indexed_list(self) -> Option<Indexed<List<T, B>>>
pub fn into_indexed_list(self) -> Option<Indexed<List<T, B>>>
Converts this indexed object into an indexed list, if it is one.
Sourcepub fn into_unnamed_graph(self) -> Result<Graph<T, B>, Self>
pub fn into_unnamed_graph(self) -> Result<Graph<T, B>, Self>
Try to convert this object into an unnamed graph.
§Errors
Returns self unchanged when the object is not a graph object, or is a named graph.
Sourcepub fn entries(&self) -> IndexedEntries<'_, T, B> ⓘ
pub fn entries(&self) -> IndexedEntries<'_, T, B> ⓘ
Returns an iterator over the entries of the JSON representation of
the object, including its @index entry if any.
Trait Implementations§
impl<T: Eq> Eq for Indexed<T>
Source§impl<T: Hash + Eq, B: Hash + Eq> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
impl<T: Hash + Eq, B: Hash + Eq> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
Source§fn extend<I: IntoIterator<Item = IndexedObject<T, B>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = IndexedObject<T, B>>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<T: Hash + Eq, B: Hash + Eq> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
impl<T: Hash + Eq, B: Hash + Eq> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
Source§fn from_iter<I: IntoIterator<Item = IndexedObject<T, B>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = IndexedObject<T, B>>>(iter: I) -> Self
Source§impl<T: IntoJsonWithContext<N>, N> IntoJsonWithContext<N> for Indexed<T>
impl<T: IntoJsonWithContext<N>, N> IntoJsonWithContext<N> for Indexed<T>
Source§impl<T: Ord> Ord for Indexed<T>
impl<T: Ord> Ord for Indexed<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialOrd> PartialOrd for Indexed<T>
impl<T: PartialOrd> PartialOrd for Indexed<T>
Source§impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Object<T, B>>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Object<T, B>>
Source§impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Node<T, B>>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Node<T, B>>
Source§impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Object<T, B>>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Object<T, B>>
Source§impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Node<T, B>>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Node<T, B>>
impl<T: PartialEq> StructuralPartialEq for Indexed<T>
Source§impl<T, B, O: TryFromJsonObject<T, B>> TryFromJson<T, B> for Indexed<O>
impl<T, B, O: TryFromJsonObject<T, B>> TryFromJson<T, B> for Indexed<O>
Source§fn try_from_json_in(
vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>,
value: Value,
) -> Result<Self, InvalidExpandedJson>
fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, value: Value, ) -> Result<Self, InvalidExpandedJson>
Source§impl<T, B, O: TryFromJsonObject<T, B>> TryFromJsonObject<T, B> for Indexed<O>
impl<T, B, O: TryFromJsonObject<T, B>> TryFromJsonObject<T, B> for Indexed<O>
Source§fn try_from_json_object_in(
vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>,
object: Object,
) -> Result<Self, InvalidExpandedJson>
fn try_from_json_object_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, object: Object, ) -> Result<Self, InvalidExpandedJson>
Auto Trait Implementations§
impl<T> Freeze for Indexed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Indexed<T>where
T: RefUnwindSafe,
impl<T> Send for Indexed<T>where
T: Send,
impl<T> Sync for Indexed<T>where
T: Sync,
impl<T> Unpin for Indexed<T>where
T: Unpin,
impl<T> UnsafeUnpin for Indexed<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Indexed<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self is equivalent to key.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.