Trait json_ld::ContextLoader
source · pub trait ContextLoader<I, M> {
type Context;
type ContextError;
fn load_context_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Send + Sync + IriVocabularyMut<Iri = I>,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>
where
I: 'a,
M: 'a;
fn load_context<'a>(
&'a mut self,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>
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§
sourcetype ContextError
type ContextError
Error type.
Required Methods§
sourcefn load_context_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Send + Sync + IriVocabularyMut<Iri = I>,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>where
I: 'a,
M: 'a,
fn load_context_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Send + Sync + IriVocabularyMut<Iri = I>,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>where
I: 'a,
M: 'a,
Loads the context behind the given IRI, using the given vocabulary.
Provided Methods§
sourcefn load_context<'a>(
&'a mut self,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>where
I: 'a,
M: 'a,
(): IriVocabulary<Iri = I>,
fn load_context<'a>(
&'a mut self,
url: I
) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Context>, Self::ContextError>> + Send + 'a, Global>>where
I: 'a,
M: 'a,
(): IriVocabulary<Iri = I>,
Loads the context behind the given IRI.