pub enum RemoteDocumentReference<I = IriIndex, M = Location<I>, T = Value<M>> {
Iri(I),
Loaded(RemoteDocument<I, M, T>),
}
Expand description
Remote document, loaded or not.
Either an IRI or the actual document content.
Variants§
Implementations§
source§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
source§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
sourcepub fn context_iri(iri: I) -> Self
pub fn context_iri(iri: I) -> Self
Creates an IRI to a json_ld_syntax::context::Value<M>
JSON-LD context document.
This method can replace RemoteDocumentReference::Iri
to help the type
inference in the case where T = json_ld_syntax::context::Value<M>
.
source§impl<I, M, T> RemoteDocumentReference<I, M, T>
impl<I, M, T> RemoteDocumentReference<I, M, T>
sourcepub async fn load_with<L: Loader<I, M>>(
self,
vocabulary: &mut (impl Sync + Send + IriVocabularyMut<Iri = I>),
loader: &mut L
) -> LoadingResult<I, M, T, L::Error>
pub async fn load_with<L: Loader<I, M>>( self, vocabulary: &mut (impl Sync + Send + IriVocabularyMut<Iri = I>), loader: &mut L ) -> LoadingResult<I, M, T, L::Error>
Loads the remote document with the given vocabulary
and loader
.
If the document is already Self::Loaded
, simply returns the inner
RemoteDocument
.
sourcepub async fn loaded_with<L: Loader<I, M>>(
&self,
vocabulary: &mut (impl Sync + Send + IriVocabularyMut<Iri = I>),
loader: &mut L
) -> Result<Mown<'_, RemoteDocument<I, M, T>>, L::Error>
pub async fn loaded_with<L: Loader<I, M>>( &self, vocabulary: &mut (impl Sync + Send + IriVocabularyMut<Iri = I>), loader: &mut L ) -> Result<Mown<'_, RemoteDocument<I, M, T>>, L::Error>
Loads the remote document with the given vocabulary
and loader
.
For Self::Iri
returns an owned RemoteDocument
with
Mown::Owned
.
For Self::Loaded
returns a reference to the inner RemoteDocument
with Mown::Borrowed
.
sourcepub async fn load_context_with<L: ContextLoader<I, M>>(
self,
vocabulary: &mut (impl Send + Sync + IriVocabularyMut<Iri = I>),
loader: &mut L
) -> LoadingResult<I, M, T, L::ContextError>
pub async fn load_context_with<L: ContextLoader<I, M>>( self, vocabulary: &mut (impl Send + Sync + IriVocabularyMut<Iri = I>), loader: &mut L ) -> LoadingResult<I, M, T, L::ContextError>
Loads the remote context definition with the given vocabulary
and
loader
.
If the document is already Self::Loaded
, simply returns the inner
RemoteDocument
.
sourcepub async fn loaded_context_with<L: ContextLoader<I, M>>(
&self,
vocabulary: &mut (impl Send + Sync + IriVocabularyMut<Iri = I>),
loader: &mut L
) -> Result<Mown<'_, RemoteDocument<I, M, T>>, L::ContextError>
pub async fn loaded_context_with<L: ContextLoader<I, M>>( &self, vocabulary: &mut (impl Send + Sync + IriVocabularyMut<Iri = I>), loader: &mut L ) -> Result<Mown<'_, RemoteDocument<I, M, T>>, L::ContextError>
Loads the remote context definition with the given vocabulary
and
loader
.
For Self::Iri
returns an owned RemoteDocument
with
Mown::Owned
.
For Self::Loaded
returns a reference to the inner RemoteDocument
with Mown::Borrowed
.