Skip to main content

CompactIndexedFragment

Trait CompactIndexedFragment 

Source
pub trait CompactIndexedFragment<I, B> {
    // Required method
    async fn compact_indexed_fragment<'a, N, L>(
        &'a self,
        vocabulary: &'a mut N,
        index: Option<&'a str>,
        active_context: &'a Context<I, B>,
        type_scoped_context: &'a Context<I, B>,
        active_property: Option<&'a str>,
        loader: &'a L,
        options: Options,
    ) -> CompactFragmentResult<L::Error>
       where N: VocabularyMut<Iri = I, BlankId = B>,
             I: Clone + Hash + Eq,
             B: Clone + Hash + Eq,
             L: Loader;
}
Expand description

Document fragments that carry an @index separately from their own contents.

Indexed<T> pairs a fragment with the index it was reached through; implementing this trait for T is what gives Indexed<T> its CompactFragment implementation. The index has to be passed down rather than read off the fragment because whether it survives into the output depends on the active property’s container mapping.

Required Methods§

Source

async fn compact_indexed_fragment<'a, N, L>( &'a self, vocabulary: &'a mut N, index: Option<&'a str>, active_context: &'a Context<I, B>, type_scoped_context: &'a Context<I, B>, active_property: Option<&'a str>, loader: &'a L, options: Options, ) -> CompactFragmentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Compacts this fragment together with the @index value it was reached through.

The index is emitted as an @index entry unless the active property’s container mapping includes @index, in which case it has already become the enclosing map’s key and is dropped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, B, T: Any<I, B>> CompactIndexedFragment<I, B> for T