pub trait ContextLoader<I, M> {
    type Context;
    type ContextError;

    // Required method
    fn load_context_with<'a>(
        &'a mut self,
        vocabulary: &'a mut (impl Send + Sync + IriVocabularyMut<Iri = I>),
        url: I
    ) -> BoxFuture<'a, LoadingResult<I, M, Self::Context, Self::ContextError>>
       where I: 'a,
             M: 'a;

    // Provided method
    fn load_context<'a>(
        &'a mut self,
        url: I
    ) -> BoxFuture<'a, LoadingResult<I, M, Self::Context, Self::ContextError>>
       where I: 'a,
             M: 'a,
             (): IriVocabulary<Iri = I> { ... }
}
Expand description

Context document loader.

This is a subclass of loaders able to extract a local context from a loaded JSON-LD document.

It is implemented for any loader where the output type implements ExtractContext.

Required Associated Types§

source

type Context

Output of the loader, a context.

source

type ContextError

Error type.

Required Methods§

source

fn load_context_with<'a>( &'a mut self, vocabulary: &'a mut (impl Send + Sync + IriVocabularyMut<Iri = I>), url: I ) -> BoxFuture<'a, LoadingResult<I, M, Self::Context, Self::ContextError>>
where I: 'a, M: 'a,

Loads the context behind the given IRI, using the given vocabulary.

Provided Methods§

source

fn load_context<'a>( &'a mut self, url: I ) -> BoxFuture<'a, LoadingResult<I, M, Self::Context, Self::ContextError>>
where I: 'a, M: 'a, (): IriVocabulary<Iri = I>,

Loads the context behind the given IRI.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I: Send, M, L: Loader<I, M>> ContextLoader<I, M> for L
where L::Output: ExtractContext<M>,

§

type Context = <<L as Loader<I, M>>::Output as ExtractContext<M>>::Context

§

type ContextError = ContextLoaderError<<L as Loader<I, M>>::Error, <<L as Loader<I, M>>::Output as ExtractContext<M>>::Error>