pub enum RemoteDocumentReference<I = IriBuf, T = Value> {
Iri(I),
Loaded(RemoteDocument<I, T>),
}
Expand description
Remote document, loaded or not.
Either an IRI or the actual document content.
Variants§
Implementations§
Source§impl<I, T> RemoteDocumentReference<I, T>
impl<I, T> RemoteDocumentReference<I, T>
Source§impl<I> RemoteDocumentReference<I>
impl<I> RemoteDocumentReference<I>
Sourcepub async fn load_with<V>(
self,
vocabulary: &mut V,
loader: &impl Loader,
) -> LoadingResult<I>
pub async fn load_with<V>( self, vocabulary: &mut V, loader: &impl Loader, ) -> LoadingResult<I>
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<V>(
&self,
vocabulary: &mut V,
loader: &impl Loader,
) -> Result<Cow<'_, RemoteDocument<V::Iri>>, LoadError>
pub async fn loaded_with<V>( &self, vocabulary: &mut V, loader: &impl Loader, ) -> Result<Cow<'_, RemoteDocument<V::Iri>>, LoadError>
Loads the remote document with the given vocabulary
and loader
.
For Self::Iri
returns an owned RemoteDocument
with
Cow::Owned
.
For Self::Loaded
returns a reference to the inner RemoteDocument
with Cow::Borrowed
.
Source§impl<I> RemoteDocumentReference<I, Context>
impl<I> RemoteDocumentReference<I, Context>
Sourcepub async fn load_context_with<V, L: Loader>(
self,
vocabulary: &mut V,
loader: &L,
) -> Result<RemoteContext<I>, ContextLoadError>
pub async fn load_context_with<V, L: Loader>( self, vocabulary: &mut V, loader: &L, ) -> Result<RemoteContext<I>, ContextLoadError>
Loads the remote context with the given vocabulary
and loader
.
If the context is already Self::Loaded
, simply returns the inner
RemoteContext
.
Sourcepub async fn loaded_context_with<V, L: Loader>(
&self,
vocabulary: &mut V,
loader: &L,
) -> Result<Cow<'_, RemoteContext<I>>, ContextLoadError>
pub async fn loaded_context_with<V, L: Loader>( &self, vocabulary: &mut V, loader: &L, ) -> Result<Cow<'_, RemoteContext<I>>, ContextLoadError>
Loads the remote context with the given vocabulary
and loader
.
For Self::Iri
returns an owned RemoteContext
with
Cow::Owned
.
For Self::Loaded
returns a reference to the inner RemoteContext
with Cow::Borrowed
.
Trait Implementations§
Source§impl<I: Clone, T: Clone> Clone for RemoteDocumentReference<I, T>
impl<I: Clone, T: Clone> Clone for RemoteDocumentReference<I, T>
Source§fn clone(&self) -> RemoteDocumentReference<I, T>
fn clone(&self) -> RemoteDocumentReference<I, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more