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>(
self,
vocabulary: &mut V,
loader: &impl Loader,
) -> Result<RemoteDocument<I>, LoadError>
pub async fn load_with<V>( self, vocabulary: &mut V, loader: &impl Loader, ) -> Result<RemoteDocument<I>, LoadError>
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 as IriVocabulary>::Iri>>, LoadError>
pub async fn loaded_with<V>( &self, vocabulary: &mut V, loader: &impl Loader, ) -> Result<Cow<'_, RemoteDocument<<V as IriVocabulary>::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>(
self,
vocabulary: &mut V,
loader: &L,
) -> Result<RemoteDocument<I, Context>, ContextLoadError>
pub async fn load_context_with<V, L>( self, vocabulary: &mut V, loader: &L, ) -> Result<RemoteDocument<I, Context>, 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>(
&self,
vocabulary: &mut V,
loader: &L,
) -> Result<Cow<'_, RemoteDocument<I, Context>>, ContextLoadError>
pub async fn loaded_context_with<V, L>( &self, vocabulary: &mut V, loader: &L, ) -> Result<Cow<'_, RemoteDocument<I, Context>>, 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, 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<N>(
&self,
other: &Self,
vocabulary: &mut N,
loader: &impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> CompareResult
async fn compare_full<N>( &self, other: &Self, vocabulary: &mut N, loader: &impl Loader, options: Options<I>, warnings: impl WarningHandler<N> + WarningHandler<N>, ) -> CompareResult
other
with a custom vocabulary using the
given options
and warnings handler. Read moreSource§async fn expand_full<N>(
&self,
vocabulary: &mut N,
loader: &impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> ExpandResult<I, N::BlankId>
async fn expand_full<N>( &self, vocabulary: &mut N, loader: &impl Loader, options: Options<I>, warnings: impl WarningHandler<N> + WarningHandler<N>, ) -> ExpandResult<I, N::BlankId>
vocabulary
and loader
, using
the given options
and warning handler. Read moreasync fn into_document_full<'a, N>( self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N>, ) -> IntoDocumentResult<I, N::BlankId>
Source§async fn compact_full<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteContextReference<I>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>,
) -> CompactResult
async fn compact_full<'a, N>( &'a self, vocabulary: &'a mut N, context: RemoteContextReference<I>, loader: &'a impl Loader, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N>, ) -> CompactResult
context
with the given vocabulary
and loader
, using the given options
and warning handler. Read moreSource§async fn flatten_full<'a, N>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
context: Option<RemoteContextReference<I>>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl 'a + WarningHandler<N> + WarningHandler<N>,
) -> FlattenResult<I, N::BlankId>
async fn flatten_full<'a, N>( &'a self, vocabulary: &'a mut N, generator: &'a mut impl Generator<N>, context: Option<RemoteContextReference<I>>, loader: &'a impl Loader, options: Options<I>, warnings: impl 'a + WarningHandler<N> + WarningHandler<N>, ) -> FlattenResult<I, N::BlankId>
vocabulary
, generator
and loader
, using the given options
and warning handler. Read moreSource§async fn compare_with_using<'a, N>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
options: Options<Iri>,
) -> CompareResult
async fn compare_with_using<'a, N>( &'a self, other: &'a Self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> CompareResult
Source§async fn compare_with<'a, N>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> CompareResult
async fn compare_with<'a, N>( &'a self, other: &'a Self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> CompareResult
other
with a custom vocabulary. Read moreSource§async fn compare_using<'a>(
&'a self,
other: &'a Self,
loader: &'a impl Loader,
options: Options<Iri>,
) -> CompareResult
async fn compare_using<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, options: Options<Iri>, ) -> CompareResult
Source§async fn compare<'a>(
&'a self,
other: &'a Self,
loader: &'a impl Loader,
) -> CompareResult
async fn compare<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, ) -> CompareResult
other
with a custom vocabulary. Read moreSource§async fn expand_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
options: Options<Iri>,
) -> ExpandResult<Iri, N::BlankId>
async fn expand_with_using<'a, N>( &'a self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> ExpandResult<Iri, N::BlankId>
Source§async fn expand_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> ExpandResult<Iri, N::BlankId>
async fn expand_with<'a, N>( &'a self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> ExpandResult<Iri, N::BlankId>
Source§async fn expand_using<'a>(
&'a self,
loader: &'a impl Loader,
options: Options<Iri>,
) -> ExpandResult<Iri, BlankIdBuf>
async fn expand_using<'a>( &'a self, loader: &'a impl Loader, options: Options<Iri>, ) -> ExpandResult<Iri, BlankIdBuf>
Source§async fn expand<'a>(
&'a self,
loader: &'a impl Loader,
) -> ExpandResult<Iri, BlankIdBuf>
async fn expand<'a>( &'a self, loader: &'a impl Loader, ) -> ExpandResult<Iri, BlankIdBuf>
loader
. Read moreasync fn into_document_with_using<'a, N>( self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> IntoDocumentResult<Iri, N::BlankId>
async fn into_document_with<'a, N>( self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> IntoDocumentResult<Iri, N::BlankId>
async fn into_document<'a>( self, loader: &'a impl Loader, ) -> IntoDocumentResult<Iri, BlankIdBuf>
Source§async fn compact_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteContextReference<Iri>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> CompactResult
async fn compact_with_using<'a, N>( &'a self, vocabulary: &'a mut N, context: RemoteContextReference<Iri>, loader: &'a impl Loader, options: Options<Iri>, ) -> CompactResult
context
with the given vocabulary
and loader
, using the given options
. Read moreSource§async fn compact_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteContextReference<Iri>,
loader: &'a impl Loader,
) -> CompactResult
async fn compact_with<'a, N>( &'a self, vocabulary: &'a mut N, context: RemoteContextReference<Iri>, loader: &'a impl Loader, ) -> CompactResult
Source§async fn compact_using<'a>(
&'a self,
context: RemoteContextReference<Iri>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> CompactResult
async fn compact_using<'a>( &'a self, context: RemoteContextReference<Iri>, loader: &'a impl Loader, options: Options<Iri>, ) -> CompactResult
Source§async fn compact<'a>(
&'a self,
context: RemoteContextReference<Iri>,
loader: &'a impl Loader,
) -> CompactResult
async fn compact<'a>( &'a self, context: RemoteContextReference<Iri>, loader: &'a impl Loader, ) -> CompactResult
Source§async fn flatten_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> FlattenResult<Iri, N::BlankId>
async fn flatten_with_using<'a, N>( &'a self, vocabulary: &'a mut N, generator: &'a mut impl Generator<N>, loader: &'a impl Loader, options: Options<Iri>, ) -> FlattenResult<Iri, N::BlankId>
vocabulary
, generator
and loader
, using the given options
. Read moreSource§async fn flatten_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
loader: &'a impl Loader,
) -> FlattenResult<Iri, N::BlankId>
async fn flatten_with<'a, N>( &'a self, vocabulary: &'a mut N, generator: &'a mut impl Generator<N>, loader: &'a impl Loader, ) -> FlattenResult<Iri, N::BlankId>
Source§async fn flatten_using<'a>(
&'a self,
generator: &'a mut impl Generator,
loader: &'a impl Loader,
options: Options<Iri>,
) -> FlattenResult<Iri, BlankIdBuf>
async fn flatten_using<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, options: Options<Iri>, ) -> FlattenResult<Iri, BlankIdBuf>
Source§async fn flatten<'a>(
&'a self,
generator: &'a mut impl Generator,
loader: &'a impl Loader,
) -> FlattenResult<Iri, BlankIdBuf>
async fn flatten<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, ) -> FlattenResult<Iri, BlankIdBuf>
Source§async fn to_rdf_full<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> ToRdfResult<N, G>
async fn to_rdf_full<N, G>( &self, vocabulary: N, generator: G, loader: &impl Loader, options: Options<Iri>, warnings: impl WarningHandler<N> + WarningHandler<N>, ) -> ToRdfResult<N, G>
options
and warnings handler. Read moreSource§async fn to_rdf_with_using<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
) -> ToRdfResult<N, G>
async fn to_rdf_with_using<N, G>( &self, vocabulary: N, generator: G, loader: &impl Loader, options: Options<Iri>, ) -> ToRdfResult<N, G>
options
. Read moreSource§async fn to_rdf_with<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
) -> ToRdfResult<N, G>
async fn to_rdf_with<N, G>( &self, vocabulary: N, generator: G, loader: &impl Loader, ) -> ToRdfResult<N, G>
Source§async fn to_rdf_using<G>(
&self,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
) -> ToRdfResult<(), G>
async fn to_rdf_using<G>( &self, generator: G, loader: &impl Loader, options: Options<Iri>, ) -> ToRdfResult<(), G>
options
. Read more