pub struct Indexed<T, M> { /* 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, M> Indexed<T, M>
impl<T, M> Indexed<T, M>
sourcepub fn new(value: T, index: Option<Entry<String, M>>) -> Indexed<T, M>
pub fn new(value: T, index: Option<Entry<String, M>>) -> Indexed<T, M>
Create a new (maybe) indexed value.
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 index_entry(&self) -> Option<&Entry<String, M>>
pub fn index_entry(&self) -> Option<&Entry<String, M>>
Get the index entry, if any.
sourcepub fn into_parts(self) -> (T, Option<Entry<String, M>>)
pub fn into_parts(self) -> (T, Option<Entry<String, M>>)
Turn this indexed value into its components: inner value and index.
source§impl<T, B, M> Indexed<Node<T, B, M>, M>
impl<T, B, M> Indexed<Node<T, B, M>, M>
pub fn entries(&self) -> IndexedEntries<'_, T, B, M> ⓘ
source§impl<T, B, M> Indexed<Node<T, B, M>, M>where
T: Eq + Hash,
B: Eq + Hash,
impl<T, B, M> Indexed<Node<T, B, M>, M>where
T: Eq + Hash,
B: Eq + Hash,
pub fn equivalent(&self, other: &Indexed<Node<T, B, M>, M>) -> bool
source§impl<T, B, M> Indexed<Object<T, B, M>, M>where
T: Eq + Hash,
B: Eq + Hash,
impl<T, B, M> Indexed<Object<T, B, M>, M>where
T: Eq + Hash,
B: Eq + Hash,
pub fn equivalent(&self, other: &Indexed<Object<T, B, M>, M>) -> bool
source§impl<T, B, M> Indexed<Object<T, B, M>, M>
impl<T, B, M> Indexed<Object<T, B, M>, M>
sourcepub fn into_indexed_node(self) -> Option<Indexed<Node<T, B, M>, M>>
pub fn into_indexed_node(self) -> Option<Indexed<Node<T, B, M>, M>>
Converts this indexed object into an indexed node, if it is one.
sourcepub fn into_indexed_value(self) -> Option<Indexed<Value<T, M>, M>>
pub fn into_indexed_value(self) -> Option<Indexed<Value<T, M>, M>>
Converts this indexed object into an indexed node, if it is one.
sourcepub fn into_indexed_list(self) -> Option<Indexed<List<T, B, M>, M>>
pub fn into_indexed_list(self) -> Option<Indexed<List<T, B, M>, M>>
Converts this indexed object into an indexed list, if it is one.
sourcepub fn into_unnamed_graph(
self
) -> Result<Meta<HashSet<Stripped<Meta<Indexed<Object<T, B, M>, M>, M>>, RandomState>, M>, Indexed<Object<T, B, M>, M>>
pub fn into_unnamed_graph(
self
) -> Result<Meta<HashSet<Stripped<Meta<Indexed<Object<T, B, M>, M>, M>>, RandomState>, M>, Indexed<Object<T, B, M>, M>>
Try to convert this object into an unnamed graph.
pub fn entries(&self) -> IndexedEntries<'_, T, B, M> ⓘ
Trait Implementations§
source§impl<I, B, M, T> CompactFragmentMeta<I, B, M> for Indexed<T, M>where
T: CompactIndexedFragment<I, B, M>,
impl<I, B, M, T> CompactFragmentMeta<I, B, M> for Indexed<T, M>where
T: CompactIndexedFragment<I, B, M>,
fn compact_fragment_full_meta<N, C, L, 'a>(
&'a self,
meta: &'a M,
vocabulary: &'a mut N,
active_context: &'a Context<I, B, C, M>,
type_scoped_context: &'a Context<I, B, C, M>,
active_property: Option<Meta<&'a str, &'a M>>,
loader: &'a mut L,
options: Options
) -> Pin<Box<dyn Future<Output = Result<Meta<Value<M>, M>, Meta<Error<<L as ContextLoader<I, M>>::ContextError>, M>>> + Send + 'a, Global>>where
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
I: Clone + Hash + Eq + Send + Sync,
B: Clone + Hash + Eq + Send + Sync,
M: Clone + Send + Sync,
C: ProcessMeta<I, B, M>,
<L as ContextLoader<I, M>>::Context: Into<C>,
source§impl<T, M, N> IntoJsonWithContextMeta<M, N> for Indexed<T, M>where
T: IntoJsonWithContextMeta<M, N>,
impl<T, M, N> IntoJsonWithContextMeta<M, N> for Indexed<T, M>where
T: IntoJsonWithContextMeta<M, N>,
source§impl<T, M> MappedEq<Indexed<T, M>> for Indexed<T, M>where
T: MappedEq<T>,
impl<T, M> MappedEq<Indexed<T, M>> for Indexed<T, M>where
T: MappedEq<T>,
type BlankId = <T as MappedEq<T>>::BlankId
source§fn mapped_eq<'a, 'b, F>(&'a self, other: &Indexed<T, M>, f: F) -> boolwhere
F: Clone + Fn(&'a <Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId) -> &'b <Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId,
<Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId: 'a + 'b,
fn mapped_eq<'a, 'b, F>(&'a self, other: &Indexed<T, M>, f: F) -> boolwhere
F: Clone + Fn(&'a <Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId) -> &'b <Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId,
<Indexed<T, M> as MappedEq<Indexed<T, M>>>::BlankId: 'a + 'b,
Structural equality with mapped blank identifiers. Read more
source§impl<T, M> Ord for Indexed<T, M>where
T: Ord,
M: Ord,
impl<T, M> Ord for Indexed<T, M>where
T: Ord,
M: 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, M> PartialEq<Indexed<T, M>> for Indexed<T, M>where
T: PartialEq<T>,
M: PartialEq<M>,
impl<T, M> PartialEq<Indexed<T, M>> for Indexed<T, M>where
T: PartialEq<T>,
M: PartialEq<M>,
source§impl<T, M> PartialOrd<Indexed<T, M>> for Indexed<T, M>where
T: PartialOrd<T>,
M: PartialOrd<M>,
impl<T, M> PartialOrd<Indexed<T, M>> for Indexed<T, M>where
T: PartialOrd<T>,
M: PartialOrd<M>,
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, M, N> PrecomputeSizeWithContext<N> for Indexed<Node<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, M, N> PrecomputeSizeWithContext<N> for Indexed<Node<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, M, N> PrecomputeSizeWithContext<N> for Indexed<Object<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, M, N> PrecomputeSizeWithContext<N> for Indexed<Object<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, M, N> PrintWithSizeAndContext<N> for Indexed<Node<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, M, N> PrintWithSizeAndContext<N> for Indexed<Node<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, B, M, N> PrintWithSizeAndContext<N> for Indexed<Object<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, M, N> PrintWithSizeAndContext<N> for Indexed<Object<T, B, M>, M>where
N: Vocabulary<Iri = T, BlankId = B>,
source§impl<T, M> StrippedHash for Indexed<T, M>where
T: StrippedHash,
impl<T, M> StrippedHash for Indexed<T, M>where
T: StrippedHash,
fn stripped_hash<H>(&self, state: &mut H)where
H: Hasher,
source§impl<T, M, __T, __M> StrippedPartialEq<Indexed<__T, __M>> for Indexed<T, M>where
T: StrippedPartialEq<__T>,
impl<T, M, __T, __M> StrippedPartialEq<Indexed<__T, __M>> for Indexed<T, M>where
T: StrippedPartialEq<__T>,
fn stripped_eq(&self, other: &Indexed<__T, __M>) -> bool
source§impl<T, B, M, O> TryFromJson<T, B, M> for Indexed<O, M>where
O: TryFromJsonObject<T, B, M>,
impl<T, B, M, O> TryFromJson<T, B, M> for Indexed<O, M>where
O: TryFromJsonObject<T, B, M>,
fn try_from_json_in(
vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>,
_: Meta<Value<M>, M>
) -> Result<Meta<Indexed<O, M>, M>, Meta<InvalidExpandedJson<M>, M>>
source§impl<T, B, M, O> TryFromJsonObject<T, B, M> for Indexed<O, M>where
O: TryFromJsonObject<T, B, M>,
impl<T, B, M, O> TryFromJsonObject<T, B, M> for Indexed<O, M>where
O: TryFromJsonObject<T, B, M>,
fn try_from_json_object_in(
vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>,
_: Meta<Object<M>, M>
) -> Result<Meta<Indexed<O, M>, M>, Meta<InvalidExpandedJson<M>, M>>
impl<T, M> Eq for Indexed<T, M>where
T: Eq,
M: Eq,
impl<T, M> StrippedEq for Indexed<T, M>where
T: StrippedEq,
impl<T, M> StructuralEq for Indexed<T, M>
impl<T, M> StructuralPartialEq for Indexed<T, M>
Auto Trait Implementations§
impl<T, M> RefUnwindSafe for Indexed<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for Indexed<T, M>where
M: Send,
T: Send,
impl<T, M> Sync for Indexed<T, M>where
M: Sync,
T: Sync,
impl<T, M> Unpin for Indexed<T, M>where
M: Unpin,
T: Unpin,
impl<T, M> UnwindSafe for Indexed<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.