Trait json_ld_core::loader::Loader
source · pub trait Loader<I, M> {
type Output;
type Error;
fn load_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Sync + Send + IriVocabularyMut<Iri = I>,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>
where
I: 'a;
fn load<'a>(
&'a mut self,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>
where
I: 'a,
(): IriVocabulary<Iri = I>,
{ ... }
}
Expand description
Document loader.
A document loader is required by most processing functions to fetch remote documents identified by an IRI.
This library provides a few default loader implementations:
NoLoader
dummy loader that always fail. Perfect if you are certain that the processing will not require any loading.FsLoader
that redirect registered IRI prefixes to a local directory on the file system. This way no network calls are performed and the loaded content can be trusted.ReqwestLoader
that actually download the remote documents using thereqwest
library. This requires thereqwest
feature to be enabled.
Required Associated Types§
Required Methods§
sourcefn load_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Sync + Send + IriVocabularyMut<Iri = I>,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>where
I: 'a,
fn load_with<'a>(
&'a mut self,
vocabulary: &'a mut impl Sync + Send + IriVocabularyMut<Iri = I>,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>where
I: 'a,
Loads the document behind the given IRI, using the given vocabulary.
Provided Methods§
sourcefn load<'a>(
&'a mut self,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>where
I: 'a,
(): IriVocabulary<Iri = I>,
fn load<'a>(
&'a mut self,
url: I
) -> BoxFuture<'a, LoadingResult<I, M, Self::Output, Self::Error>>where
I: 'a,
(): IriVocabulary<Iri = I>,
Loads the document behind the given IRI.