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
sourceimpl<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.
sourceimpl<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>ⓘNotable traits for IndexedEntries<'a, T, B, M>impl<'a, T, B, M> Iterator for IndexedEntries<'a, T, B, M> type Item = IndexedEntryRef<'a, T, B, M>;
sourceimpl<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
sourceimpl<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
sourceimpl<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>ⓘNotable traits for IndexedEntries<'a, T, B, M>impl<'a, T, B, M> Iterator for IndexedEntries<'a, T, B, M> type Item = IndexedEntryRef<'a, T, B, M>;
Trait Implementations
sourceimpl<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>
fn into_json_meta_with(self, meta: M, vocabulary: &N) -> Meta<Value<M>, M>
sourceimpl<T: Ord, M: Ord> Ord for Indexed<T, M>
impl<T: Ord, M: Ord> Ord for Indexed<T, M>
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq, M: PartialEq> PartialEq<Indexed<T, M>> for Indexed<T, M>
impl<T: PartialEq, M: PartialEq> PartialEq<Indexed<T, M>> for Indexed<T, M>
sourceimpl<T: PartialOrd, M: PartialOrd> PartialOrd<Indexed<T, M>> for Indexed<T, M>
impl<T: PartialOrd, M: PartialOrd> PartialOrd<Indexed<T, M>> for Indexed<T, M>
sourcefn partial_cmp(&self, other: &Indexed<T, M>) -> Option<Ordering>
fn partial_cmp(&self, other: &Indexed<T, M>) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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)
sourceimpl<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
sourceimpl<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>>
sourceimpl<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>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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowStripped for T
impl<T> BorrowStripped for T
sourceimpl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
sourceimpl<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
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.