Skip to main content

Compact

Trait Compact 

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

    // 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, W>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, options: Options, warnings: W, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader, W: WarningHandler<N>,

Compacts this document with the given Options.

warnings receives every warning raised while processing the scoped contexts compaction meets.

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.

Warnings are printed to standard error.

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.

Warnings are printed to standard error.

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, W>( &'a self, vocabulary: &'a mut N, context: ProcessedRef<'a, 'a, I, B>, loader: &'a L, options: Options, warnings: W, ) -> CompactDocumentResult<L::Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader, W: WarningHandler<N>,

Source§

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

Source§

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

Implementors§