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§
§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
pub 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>.
§impl<I, M> RemoteDocumentReference<I, M, Value<M>>
impl<I, M> RemoteDocumentReference<I, M, Value<M>>
pub 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>.
§impl<I, M, T> RemoteDocumentReference<I, M, T>
impl<I, M, T> RemoteDocumentReference<I, M, 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>,
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].
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>,
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].
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>,
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].
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>,
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§
§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,
§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 RemoteDocumentReference<I, M, Value<M>>,
vocabulary: &'a mut N,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a
) -> Pin<Box<dyn Future<Output = Result<bool, ExpandError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>,
<L as Loader<I, M>>::Error: Send,
<L as ContextLoader<I, M>>::Context: Into<C>,
<L as ContextLoader<I, M>>::ContextError: Send,
fn compare_full<'a, B, C, N, L>( &'a self, other: &'a RemoteDocumentReference<I, M, Value<M>>, vocabulary: &'a mut N, loader: &'a mut L, options: Options<I, M, C>, warnings: impl Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a ) -> Pin<Box<dyn Future<Output = Result<bool, ExpandError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>, <L as Loader<I, M>>::Error: Send, <L as ContextLoader<I, M>>::Context: Into<C>, <L as ContextLoader<I, M>>::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 Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a
) -> Pin<Box<dyn Future<Output = Result<Meta<ExpandedDocument<I, B, M>, M>, ExpandError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>,
<L as Loader<I, M>>::Error: Send,
<L as ContextLoader<I, M>>::Context: Into<C>,
<L as ContextLoader<I, M>>::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 Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a ) -> Pin<Box<dyn Future<Output = Result<Meta<ExpandedDocument<I, B, M>, M>, ExpandError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>, <L as Loader<I, M>>::Error: Send, <L as ContextLoader<I, M>>::Context: Into<C>, <L as ContextLoader<I, M>>::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 Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a
) -> Pin<Box<dyn Future<Output = Result<Meta<Value<M>, M>, CompactError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>,
<L as Loader<I, M>>::Error: Send,
<L as ContextLoader<I, M>>::Context: Into<C>,
<L as ContextLoader<I, M>>::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 Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a ) -> Pin<Box<dyn Future<Output = Result<Meta<Value<M>, M>, CompactError<M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>, <L as Loader<I, M>>::Error: Send, <L as ContextLoader<I, M>>::Context: Into<C>, <L as ContextLoader<I, M>>::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 + MetaGenerator<N, M>,
context: Option<RemoteDocumentReference<I, M, C>>,
loader: &'a mut L,
options: Options<I, M, C>,
warnings: impl Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a
) -> Pin<Box<dyn Future<Output = Result<Meta<Value<M>, M>, FlattenError<I, B, M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>,
<L as Loader<I, M>>::Error: Send,
<L as ContextLoader<I, M>>::Context: Into<C>,
<L as ContextLoader<I, M>>::ContextError: Send,
fn flatten_full<'a, B, C, N, L>( &'a self, vocabulary: &'a mut N, generator: &'a mut impl Send + MetaGenerator<N, M>, context: Option<RemoteDocumentReference<I, M, C>>, loader: &'a mut L, options: Options<I, M, C>, warnings: impl Send + WarningHandler<N, M> + WarningHandler<B, N, M> + 'a ) -> Pin<Box<dyn Future<Output = Result<Meta<Value<M>, M>, FlattenError<I, B, M, <L as Loader<I, M>>::Error, <L as ContextLoader<I, M>>::ContextError>>> + Send + 'a, Global>>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 as Loader<I, M>>::Output: Into<Value<M>>, <L as Loader<I, M>>::Error: Send, <L as ContextLoader<I, M>>::Context: Into<C>, <L as ContextLoader<I, M>>::ContextError: Send,
vocabulary, generator
and loader, using the given options and warning handler. Read more