Enum json_ld::RemoteDocumentReference
source · 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>
sourcepub fn iri(iri: I) -> RemoteDocumentReference<I, T>
pub fn iri(iri: I) -> RemoteDocumentReference<I, T>
Creates an IRI to a json_syntax::Value
JSON document.
This method can replace RemoteDocumentReference::Iri
to help the type
inference in the case where T = json_syntax::Value
.
source§impl<I> RemoteDocumentReference<I>
impl<I> RemoteDocumentReference<I>
sourcepub async fn load_with<V, L>(
self,
vocabulary: &mut V,
loader: &mut L
) -> Result<RemoteDocument<I>, <L as Loader<I>>::Error>where
L: Loader<I>,
V: IriVocabularyMut<Iri = I>,
pub async fn load_with<V, L>(
self,
vocabulary: &mut V,
loader: &mut L
) -> Result<RemoteDocument<I>, <L as Loader<I>>::Error>where
L: Loader<I>,
V: IriVocabularyMut<Iri = 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, L>(
&self,
vocabulary: &mut V,
loader: &mut L
) -> Result<Cow<'_, RemoteDocument<I>>, <L as Loader<I>>::Error>
pub async fn loaded_with<V, L>( &self, vocabulary: &mut V, loader: &mut L ) -> Result<Cow<'_, RemoteDocument<I>>, <L as Loader<I>>::Error>
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>(
self,
vocabulary: &mut V,
loader: &mut L
) -> Result<RemoteDocument<I, Context>, ContextLoadError<<L as Loader<I>>::Error>>where
L: Loader<I>,
V: IriVocabularyMut<Iri = I>,
pub async fn load_context_with<V, L>(
self,
vocabulary: &mut V,
loader: &mut L
) -> Result<RemoteDocument<I, Context>, ContextLoadError<<L as Loader<I>>::Error>>where
L: Loader<I>,
V: IriVocabularyMut<Iri = I>,
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>(
&self,
vocabulary: &mut V,
loader: &mut L
) -> Result<Cow<'_, RemoteDocument<I, Context>>, ContextLoadError<<L as Loader<I>>::Error>>
pub async fn loaded_context_with<V, L>( &self, vocabulary: &mut V, loader: &mut L ) -> Result<Cow<'_, RemoteDocument<I, Context>>, ContextLoadError<<L as Loader<I>>::Error>>
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, T> Clone for RemoteDocumentReference<I, T>
impl<I, T> 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 moresource§impl<I> JsonLdProcessor<I> for RemoteDocumentReference<I, Value>
impl<I> JsonLdProcessor<I> for RemoteDocumentReference<I, Value>
source§async fn compare_full<'a, N, L>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>
) -> CompareResult<I, L>
async fn compare_full<'a, N, L>( &'a self, other: &'a Self, vocabulary: &'a mut N, loader: &'a mut L, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N> ) -> CompareResult<I, L>
other
with a custom vocabulary using the
given options
and warnings handler. Read moresource§async fn expand_full<'a, N, L>(
&'a self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>
) -> ExpandResult<I, N::BlankId, L>
async fn expand_full<'a, N, L>( &'a self, vocabulary: &'a mut N, loader: &'a mut L, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N> ) -> ExpandResult<I, N::BlankId, L>
vocabulary
and loader
, using
the given options
and warning handler. Read moreasync fn into_document_full<'a, N, L>( self, vocabulary: &'a mut N, loader: &'a mut L, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N> ) -> IntoDocumentResult<I, N::BlankId, L>
source§async fn compact_full<'a, N, L>(
&'a self,
vocabulary: &'a mut N,
context: RemoteContextReference<I>,
loader: &'a mut L,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>
) -> CompactResult<I, L>
async fn compact_full<'a, N, L>( &'a self, vocabulary: &'a mut N, context: RemoteContextReference<I>, loader: &'a mut L, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N> ) -> CompactResult<I, L>
context
with the given vocabulary
and loader
, using the given options
and warning handler. Read moresource§async fn flatten_full<'a, N, L>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
context: Option<RemoteContextReference<I>>,
loader: &'a mut L,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>
) -> FlattenResult<I, N::BlankId, L>
async fn flatten_full<'a, N, L>( &'a self, vocabulary: &'a mut N, generator: &'a mut impl Generator<N>, context: Option<RemoteContextReference<I>>, loader: &'a mut L, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N> ) -> FlattenResult<I, N::BlankId, L>
vocabulary
, generator
and loader
, using the given options
and warning handler. Read more