Skip to main content

Compact

Trait Compact 

Source
pub trait Compact<I, B> {
    // Required method
    async fn compact_full<'a, N, L>(
        &'a self,
        vocabulary: &'a mut N,
        context: ProcessedRef<'a, 'a, I, B>,
        loader: &'a L,
        options: Options,
    ) -> CompactDocumentResult<L::Error>
       where N: VocabularyMut<Iri = I, BlankId = B>,
             I: Clone + Hash + Eq,
             B: Clone + Hash + Eq,
             L: Loader;

    // Provided methods
    async fn compact_with<'a, N, L>(
        &'a self,
        vocabulary: &'a mut N,
        context: ProcessedRef<'a, 'a, I, B>,
        loader: &'a L,
    ) -> CompactDocumentResult<L::Error>
       where N: VocabularyMut<Iri = I, BlankId = B>,
             I: Clone + Hash + Eq,
             B: Clone + Hash + Eq,
             L: Loader { ... }
    async fn compact<'a, L>(
        &'a self,
        context: ProcessedRef<'a, 'a, I, B>,
        loader: &'a L,
    ) -> CompactDocumentResult<L::Error>
       where (): VocabularyMut<Iri = I, BlankId = B>,
             I: Clone + Hash + Eq,
             B: Clone + Hash + Eq,
             L: Loader { ... }
}
Expand description

Whole documents that can be compacted against a processed @context.

Implemented for ExpandedDocument and FlattenedDocument. Unlike CompactFragment, these methods take the context in both its processed and its original form: the processed form drives compaction, and the original form is embedded into the output as its @context.

Required Methods§

Source

async fn compact_full<'a, N, L>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, options: Options, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Compacts this document with the given Options.

Provided Methods§

Source

async fn compact_with<'a, N, L>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Compacts this document with the default Options, using vocabulary to resolve IRI and blank node identifiers.

Source

async fn compact<'a, L>( &'a self, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, ) -> CompactDocumentResult<L::Error>
where (): VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Compacts this document with the default Options, for documents that store IRIs and blank node identifiers inline instead of indexing them through a vocabulary.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<I, B> Compact<I, B> for ExpandedDocument<I, B>

Source§

async fn compact_full<'a, N, L>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, options: Options, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Source§

impl<I, B> Compact<I, B> for FlattenedDocument<I, B>

Source§

async fn compact_full<'a, N, L>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, options: Options, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Implementors§