pub trait Loader {
    type Document: Json;
    fn id(&self, iri: Iri<'_>) -> Option<Id>;
fn iri(&self, id: Id) -> Option<Iri<'_>>;
fn load<'a>(
        &'a mut self,
        url: Iri<'_>
    ) -> BoxFuture<'a, Result<RemoteDocument<Self::Document>, Error>>; fn id_opt(&self, iri: Option<Iri<'_>>) -> Option<Id> { ... } }
Expand description

JSON document loader.

Each document is uniquely identified by the loader by a u32.

Associated Types

The type of documents that can be loaded.

Required methods

Returns the unique identifier associated to the given IRI, if any.

Returns the IRI with the given identifier, if any.

Loads the document behind the given IRI.

Provided methods

Returns the unique identifier associated to the given IRI, if any.

Returns None if the input iri is None.

Implementors