Enum json_ld::RemoteDocumentReference
source · pub enum RemoteDocumentReference<I = Index, M = Location<I, Span>, T = Value<M>> {
Iri(I),
Loaded(RemoteDocument<I, M, T>),
}Expand description
Remote document, loaded or not.
Either an IRI or the actual document content.
Variants§
Implementations§
source§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
sourcepub fn iri(iri: I) -> RemoteDocumentReference<I, M, Value<M>>
pub fn iri(iri: I) -> RemoteDocumentReference<I, M, Value<M>>
Creates an IRI to a json_syntax::Value<M> JSON document.
This method can replace RemoteDocumentReference::Iri to help the type
inference in the case where T = json_syntax::Value<M>.
source§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
sourcepub fn context_iri(iri: I) -> RemoteDocumentReference<I, M, Value<M>>
pub fn context_iri(iri: I) -> RemoteDocumentReference<I, M, Value<M>>
Creates an IRI to a json_ld_syntax::context::Value<M> JSON-LD context document.
This method can replace RemoteDocumentReference::Iri to help the type
inference in the case where T = json_ld_syntax::context::Value<M>.
source§impl<I, M, T> RemoteDocumentReference<I, M, T>
impl<I, M, T> RemoteDocumentReference<I, M, T>
sourcepub async fn load_with<L>(
self,
vocabulary: &mut impl Sync + Send + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<RemoteDocument<I, M, T>, <L as Loader<I, M>>::Error>>where
L: Loader<I, M>,
<L as Loader<I, M>>::Output: Into<T>,
pub async fn load_with<L>(
self,
vocabulary: &mut impl Sync + Send + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<RemoteDocument<I, M, T>, <L as Loader<I, M>>::Error>>where
L: Loader<I, M>,
<L as Loader<I, M>>::Output: Into<T>,
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<L>(
&self,
vocabulary: &mut impl Sync + Send + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<Mown<'_, RemoteDocument<I, M, T>>, <L as Loader<I, M>>::Error>>where
L: Loader<I, M>,
I: Clone,
<L as Loader<I, M>>::Output: Into<T>,
pub async fn loaded_with<L>(
&self,
vocabulary: &mut impl Sync + Send + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<Mown<'_, RemoteDocument<I, M, T>>, <L as Loader<I, M>>::Error>>where
L: Loader<I, M>,
I: Clone,
<L as Loader<I, M>>::Output: Into<T>,
Loads the remote document with the given vocabulary and loader.
For Self::Iri returns an owned RemoteDocument with
[Mown::Owned].
For Self::Loaded returns a reference to the inner RemoteDocument
with [Mown::Borrowed].
sourcepub async fn load_context_with<L>(
self,
vocabulary: &mut impl Send + Sync + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<RemoteDocument<I, M, T>, <L as ContextLoader<I, M>>::ContextError>>where
L: ContextLoader<I, M>,
<L as ContextLoader<I, M>>::Context: Into<T>,
pub async fn load_context_with<L>(
self,
vocabulary: &mut impl Send + Sync + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<RemoteDocument<I, M, T>, <L as ContextLoader<I, M>>::ContextError>>where
L: ContextLoader<I, M>,
<L as ContextLoader<I, M>>::Context: Into<T>,
Loads the remote context definition with the given vocabulary and
loader.
If the document is already Self::Loaded, simply returns the inner
RemoteDocument.
sourcepub async fn loaded_context_with<L>(
&self,
vocabulary: &mut impl Send + Sync + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<Mown<'_, RemoteDocument<I, M, T>>, <L as ContextLoader<I, M>>::ContextError>>where
L: ContextLoader<I, M>,
I: Clone,
<L as ContextLoader<I, M>>::Context: Into<T>,
pub async fn loaded_context_with<L>(
&self,
vocabulary: &mut impl Send + Sync + IriVocabularyMut<Iri = I>,
loader: &mut L
) -> impl Future<Output = Result<Mown<'_, RemoteDocument<I, M, T>>, <L as ContextLoader<I, M>>::ContextError>>where
L: ContextLoader<I, M>,
I: Clone,
<L as ContextLoader<I, M>>::Context: Into<T>,
Loads the remote context definition with the given vocabulary and
loader.
For Self::Iri returns an owned RemoteDocument with
[Mown::Owned].
For Self::Loaded returns a reference to the inner RemoteDocument
with [Mown::Borrowed].
Trait Implementations§
source§impl<I, M, T> Clone for RemoteDocumentReference<I, M, T>where
I: Clone,
M: Clone,
T: Clone,
impl<I, M, T> Clone for RemoteDocumentReference<I, M, T>where
I: Clone,
M: Clone,
T: Clone,
source§fn clone(&self) -> RemoteDocumentReference<I, M, T>
fn clone(&self) -> RemoteDocumentReference<I, M, T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<I, M> JsonLdProcessor<I, M> for RemoteDocumentReference<I, M, Value<M>>
impl<I, M> JsonLdProcessor<I, M> for RemoteDocumentReference<I, M, Value<M>>
source§fn compare_full<'a, B, C, N, L>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'_, CompareResult<I, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
fn compare_full<'a, B, C, N, L>(
&'a self,
other: &'a Self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'_, CompareResult<I, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
other with a custom vocabulary using the
given options and warnings handler. Read moresource§fn expand_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'_, ExpandResult<I, B, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
fn expand_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'_, ExpandResult<I, B, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
vocabulary and loader, using
the given options and warning handler. Read moresource§fn compact_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<I, M, C>,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'a, CompactResult<I, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
fn compact_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
context: RemoteDocumentReference<I, M, C>,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'a, CompactResult<I, M, L>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
context with the given vocabulary
and loader, using the given options and warning handler. Read moresource§fn flatten_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Send + Generator<N, M>,
context: Option<RemoteDocumentReference<I, M, C>>,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'a, Result<MetaValue<M>, FlattenError<I, B, M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
fn flatten_full<'a, B, C, N, L>(
&'a self,
vocabulary: &'a mut N,
generator: &'a mut impl Send + Generator<N, M>,
context: Option<RemoteDocumentReference<I, M, C>>,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl 'a + Send + WarningHandler<N, M> + WarningHandler<B, N, M>
) -> BoxFuture<'a, Result<MetaValue<M>, FlattenError<I, B, M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>>where
I: Clone + Eq + Hash + Send + Sync,
B: 'a + Clone + Eq + Hash + Send + Sync,
C: 'a + ProcessMeta<I, B, M> + From<Value<M>>,
N: Send + Sync + VocabularyMut<Iri = I, BlankId = B>,
M: Clone + Send + Sync,
L: Loader<I, M> + ContextLoader<I, M> + Send + Sync,
L::Output: Into<Value<M>>,
L::Error: Send,
L::Context: Into<C>,
L::ContextError: Send,
vocabulary, generator
and loader, using the given options and warning handler. Read more