Struct json_ld_core::Indexed
source · 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: Eq + Hash, B: Eq + Hash, M> Indexed<Node<T, B, M>, M>
impl<T: Eq + Hash, B: Eq + Hash, M> Indexed<Node<T, B, M>, M>
pub fn equivalent(&self, other: &Self) -> bool
source§impl<T: Eq + Hash, B: Eq + Hash, M> Indexed<Object<T, B, M>, M>
impl<T: Eq + Hash, B: Eq + Hash, M> Indexed<Object<T, B, M>, M>
pub fn equivalent(&self, other: &Self) -> 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<Graph<T, B, M>, M>, Self>
pub fn into_unnamed_graph(self) -> Result<Meta<Graph<T, B, M>, M>, Self>
Try to convert this object into an unnamed graph.
pub fn entries(&self) -> IndexedEntries<'_, T, B, M> ⓘ
Trait Implementations§
source§impl<T: IntoJsonWithContextMeta<M, N>, M, N> IntoJsonWithContextMeta<M, N> for Indexed<T, M>
impl<T: IntoJsonWithContextMeta<M, N>, M, N> IntoJsonWithContextMeta<M, N> for Indexed<T, M>
source§impl<T: Ord, M: Ord> Ord for Indexed<T, M>
impl<T: Ord, M: Ord> Ord for Indexed<T, M>
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, M: PartialEq> PartialEq for Indexed<T, M>
impl<T: PartialEq, M: PartialEq> PartialEq for Indexed<T, M>
source§impl<T: PartialOrd, M: PartialOrd> PartialOrd for Indexed<T, M>
impl<T: PartialOrd, M: PartialOrd> PartialOrd for Indexed<T, 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: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Node<T, B, M>, M>
impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Node<T, B, M>, M>
source§impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Object<T, B, M>, M>
impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Indexed<Object<T, B, M>, M>
source§impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Node<T, B, M>, M>
impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Node<T, B, M>, M>
source§impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Object<T, B, M>, M>
impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Indexed<Object<T, B, M>, M>
source§impl<T: StrippedHash, M> StrippedHash for Indexed<T, M>
impl<T: StrippedHash, M> StrippedHash for Indexed<T, M>
fn stripped_hash<H: Hasher>(&self, state: &mut H)
source§impl<T: StrippedPartialEq<__T>, M, __T, __M> StrippedPartialEq<Indexed<__T, __M>> for Indexed<T, M>
impl<T: StrippedPartialEq<__T>, M, __T, __M> StrippedPartialEq<Indexed<__T, __M>> for Indexed<T, M>
fn stripped_eq(&self, other: &Indexed<__T, __M>) -> bool
source§impl<T, B, M, O: TryFromJsonObject<T, B, M>> TryFromJson<T, B, M> for Indexed<O, M>
impl<T, B, M, O: TryFromJsonObject<T, B, M>> TryFromJson<T, B, M> for Indexed<O, M>
fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, Meta: Meta<Value<M>, M> ) -> Result<Meta<Self, M>, Meta<InvalidExpandedJson<M>, M>>
source§impl<T, B, M, O: TryFromJsonObject<T, B, M>> TryFromJsonObject<T, B, M> for Indexed<O, M>
impl<T, B, M, O: TryFromJsonObject<T, B, M>> TryFromJsonObject<T, B, M> for Indexed<O, M>
fn try_from_json_object_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, Meta: Meta<Object<M>, M> ) -> Result<Meta<Self, M>, Meta<InvalidExpandedJson<M>, M>>
impl<T: Eq, M: Eq> Eq for Indexed<T, M>
impl<T: StrippedEq, M> StrippedEq for Indexed<T, M>
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>
impl<T, M> Sync for Indexed<T, M>
impl<T, M> Unpin for Indexed<T, M>
impl<T, M> UnwindSafe for Indexed<T, M>where
M: UnwindSafe,
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
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.