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>
pub fn inner_mut(&mut self) -> &mut T
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Drop the index and return the underlying value.
sourcepub fn into_parts(self) -> (T, Option<String>)
pub fn into_parts(self) -> (T, Option<String>)
Turn this indexed value into its components: inner value and index.
source§impl<T, B> Indexed<Node<T, B>>
impl<T, B> Indexed<Node<T, B>>
pub fn equivalent(&self, other: &Indexed<Node<T, B>>) -> bool
source§impl<T, B> Indexed<Object<T, B>>
impl<T, B> Indexed<Object<T, B>>
pub fn equivalent(&self, other: &Indexed<Object<T, B>>) -> bool
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 node, 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<IndexSet<Indexed<Object<T, B>>>, Indexed<Object<T, B>>>
pub fn into_unnamed_graph( self ) -> Result<IndexSet<Indexed<Object<T, B>>>, Indexed<Object<T, B>>>
Try to convert this object into an unnamed graph.
pub fn entries(&self) -> IndexedEntries<'_, T, B> ⓘ
Trait Implementations§
source§impl<I, B, T> CompactFragment<I, B> for Indexed<T>where
T: CompactIndexedFragment<I, B>,
impl<I, B, T> CompactFragment<I, B> for Indexed<T>where
T: CompactIndexedFragment<I, B>,
source§impl<T, B> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
impl<T, B> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
source§fn extend<I>(&mut self, iter: I)
fn extend<I>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T, B> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
impl<T, B> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>
source§fn from_iter<I>(iter: I) -> ExpandedDocument<T, B>
fn from_iter<I>(iter: I) -> ExpandedDocument<T, B>
Creates a value from an iterator. Read more
source§impl<T, N> IntoJsonWithContext<N> for Indexed<T>where
T: IntoJsonWithContext<N>,
impl<T, N> IntoJsonWithContext<N> for Indexed<T>where
T: IntoJsonWithContext<N>,
fn into_json_with(self, vocabulary: &N) -> Value
source§impl<T> Ord for Indexed<T>where
T: Ord,
impl<T> Ord for Indexed<T>where
T: Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T> PartialEq for Indexed<T>where
T: PartialEq,
impl<T> PartialEq for Indexed<T>where
T: PartialEq,
source§impl<T> PartialOrd for Indexed<T>where
T: PartialOrd,
impl<T> PartialOrd for Indexed<T>where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T, B, N> PrecomputeSizeWithContext<N> for Indexed<Node<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> PrecomputeSizeWithContext<N> for Indexed<Node<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, N> PrecomputeSizeWithContext<N> for Indexed<Object<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> PrecomputeSizeWithContext<N> for Indexed<Object<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, N> PrintWithSizeAndContext<N> for Indexed<Node<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> PrintWithSizeAndContext<N> for Indexed<Node<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, N> PrintWithSizeAndContext<N> for Indexed<Object<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> PrintWithSizeAndContext<N> for Indexed<Object<T, B>>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, O> TryFromJson<T, B> for Indexed<O>where
O: TryFromJsonObject<T, B>,
impl<T, B, O> TryFromJson<T, B> for Indexed<O>where
O: TryFromJsonObject<T, B>,
fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, value: Value ) -> Result<Indexed<O>, InvalidExpandedJson>
source§impl<T, B, O> TryFromJsonObject<T, B> for Indexed<O>where
O: TryFromJsonObject<T, B>,
impl<T, B, O> TryFromJsonObject<T, B> for Indexed<O>where
O: TryFromJsonObject<T, B>,
fn try_from_json_object_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, object: Object ) -> Result<Indexed<O>, InvalidExpandedJson>
impl<T> Eq for Indexed<T>where
T: Eq,
impl<T> StructuralPartialEq for Indexed<T>
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> 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
Mutably borrows from an owned value. Read more
source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CallHasher for T
impl<T> CallHasher for T
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§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
Compare self to
key
and return true
if they are equal.