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§
Auto Trait Implementations§
impl<I, T> Freeze for RemoteDocumentReference<I, T>
impl<I, T> RefUnwindSafe for RemoteDocumentReference<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Send for RemoteDocumentReference<I, T>
impl<I, T> Sync for RemoteDocumentReference<I, T>
impl<I, T> Unpin for RemoteDocumentReference<I, T>
impl<I, T> UnwindSafe for RemoteDocumentReference<I, T>where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)