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>
impl<I> JsonLdProcessor<I> for RemoteDocumentReference<I>
Source§async fn compare_full<N>(
&self,
other: &RemoteDocumentReference<I>,
vocabulary: &mut N,
loader: &impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
async fn compare_full<N>(
&self,
other: &RemoteDocumentReference<I>,
vocabulary: &mut N,
loader: &impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
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>,
) -> Result<ExpandedDocument<I, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
async fn expand_full<N>(
&self,
vocabulary: &mut N,
loader: &impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> Result<ExpandedDocument<I, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
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 WarningHandler<N> + WarningHandler<N> + 'a,
) -> Result<Document<I, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = I>,
I: 'a + Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn compact_full<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<I, Context>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N> + 'a,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn compact_full<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<I, Context>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N> + 'a,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
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<RemoteDocumentReference<I, Context>>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N> + 'a,
) -> Result<Value, FlattenError<I, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn flatten_full<'a, N>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
context: Option<RemoteDocumentReference<I, Context>>,
loader: &'a impl Loader,
options: Options<I>,
warnings: impl WarningHandler<N> + WarningHandler<N> + 'a,
) -> Result<Value, FlattenError<I, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = I>,
I: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
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>,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn compare_with_using<'a, N>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn compare_with<'a, N>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn compare_with<'a, N>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> Result<bool, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
other with a custom vocabulary. Read moreSource§async fn compare_using<'a>(
&'a self,
other: &'a Self,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<bool, ExpandError>
async fn compare_using<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, options: Options<Iri>, ) -> Result<bool, ExpandError>
Source§async fn compare<'a>(
&'a self,
other: &'a Self,
loader: &'a impl Loader,
) -> Result<bool, ExpandError>
async fn compare<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, ) -> Result<bool, ExpandError>
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>,
) -> Result<ExpandedDocument<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn expand_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<ExpandedDocument<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn expand_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> Result<ExpandedDocument<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn expand_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> Result<ExpandedDocument<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn expand_using<'a>(
&'a self,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<ExpandedDocument<Iri>, ExpandError>
async fn expand_using<'a>( &'a self, loader: &'a impl Loader, options: Options<Iri>, ) -> Result<ExpandedDocument<Iri>, ExpandError>
Source§async fn expand<'a>(
&'a self,
loader: &'a impl Loader,
) -> Result<ExpandedDocument<Iri>, ExpandError>
async fn expand<'a>( &'a self, loader: &'a impl Loader, ) -> Result<ExpandedDocument<Iri>, ExpandError>
loader. Read moreasync fn into_document_with_using<'a, N>(
self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<Document<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: 'a + Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn into_document_with<'a, N>(
self,
vocabulary: &'a mut N,
loader: &'a impl Loader,
) -> Result<Document<Iri, <N as BlankIdVocabulary>::BlankId>, ExpandError>where
N: VocabularyMut<Iri = Iri>,
Iri: 'a + Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn into_document<'a>( self, loader: &'a impl Loader, ) -> Result<Document<Iri>, ExpandError>
Source§async fn compact_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn compact_with_using<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
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: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn compact_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
) -> Result<Value, CompactError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn compact_using<'a>(
&'a self,
context: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<Value, CompactError>
async fn compact_using<'a>( &'a self, context: RemoteDocumentReference<Iri, Context>, loader: &'a impl Loader, options: Options<Iri>, ) -> Result<Value, CompactError>
Source§async fn compact<'a>(
&'a self,
context: RemoteDocumentReference<Iri, Context>,
loader: &'a impl Loader,
) -> Result<Value, CompactError>
async fn compact<'a>( &'a self, context: RemoteDocumentReference<Iri, Context>, loader: &'a impl Loader, ) -> Result<Value, CompactError>
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>,
) -> Result<Value, FlattenError<Iri, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
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>,
) -> Result<Value, FlattenError<Iri, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
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,
) -> Result<Value, FlattenError<Iri, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
async fn flatten_with<'a, N>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Generator<N>,
loader: &'a impl Loader,
) -> Result<Value, FlattenError<Iri, <N as BlankIdVocabulary>::BlankId>>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: 'a + Clone + Eq + Hash,
Source§async fn flatten_using<'a>(
&'a self,
generator: &'a mut impl Generator,
loader: &'a impl Loader,
options: Options<Iri>,
) -> Result<Value, FlattenError<Iri, BlankIdBuf>>
async fn flatten_using<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, options: Options<Iri>, ) -> Result<Value, FlattenError<Iri, BlankIdBuf>>
Source§async fn flatten<'a>(
&'a self,
generator: &'a mut impl Generator,
loader: &'a impl Loader,
) -> Result<Value, FlattenError<Iri, BlankIdBuf>>
async fn flatten<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, ) -> Result<Value, FlattenError<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>,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
async fn to_rdf_full<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
warnings: impl WarningHandler<N> + WarningHandler<N>,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
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>,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
async fn to_rdf_with_using<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
options. Read moreSource§async fn to_rdf_with<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
async fn to_rdf_with<N, G>(
&self,
vocabulary: N,
generator: G,
loader: &impl Loader,
) -> Result<ToRdf<N, G>, ToRdfError>where
N: VocabularyMut<Iri = Iri>,
Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + Eq + Hash,
G: Generator<N>,
Source§async fn to_rdf_using<G>(
&self,
generator: G,
loader: &impl Loader,
options: Options<Iri>,
) -> Result<ToRdf<(), G>, ToRdfError>
async fn to_rdf_using<G>( &self, generator: G, loader: &impl Loader, options: Options<Iri>, ) -> Result<ToRdf<(), G>, ToRdfError>
options. Read more