Enum 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§

§

Iri(I)

IRI to the remote document.

§

Loaded(RemoteDocument<I, T>)

Remote document content.

Implementations§

Source§

impl<I, T> RemoteDocumentReference<I, T>

Source

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>

Source

pub async fn load_with<V>( self, vocabulary: &mut V, loader: &impl Loader, ) -> Result<RemoteDocument<I>, LoadError>
where V: IriVocabularyMut<Iri = I>, I: Clone + Eq + Hash,

Loads the remote document with the given vocabulary and loader.

If the document is already Self::Loaded, simply returns the inner RemoteDocument.

Source

pub async fn loaded_with<V>( &self, vocabulary: &mut V, loader: &impl Loader, ) -> Result<Cow<'_, RemoteDocument<<V as IriVocabulary>::Iri>>, LoadError>
where V: IriVocabularyMut<Iri = I>, I: Clone + Eq + Hash,

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>

Source

pub async fn load_context_with<V, L>( self, vocabulary: &mut V, loader: &L, ) -> Result<RemoteDocument<I, Context>, ContextLoadError>
where L: Loader, V: IriVocabularyMut<Iri = I>, I: Clone + Eq + Hash,

Loads the remote context with the given vocabulary and loader.

If the context is already Self::Loaded, simply returns the inner RemoteContext.

Source

pub async fn loaded_context_with<V, L>( &self, vocabulary: &mut V, loader: &L, ) -> Result<Cow<'_, RemoteDocument<I, Context>>, ContextLoadError>
where L: Loader, V: IriVocabularyMut<Iri = I>, I: Clone + Eq + Hash,

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>
where I: Clone, T: Clone,

Source§

fn clone(&self) -> RemoteDocumentReference<I, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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
where N: VocabularyMut<Iri = I>, I: Clone + Eq + Hash, N::BlankId: Clone + Eq + Hash,

Compare this document against other with a custom vocabulary using the given options and warnings handler. Read more
Source§

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>
where N: VocabularyMut<Iri = I>, I: Clone + Eq + Hash, N::BlankId: Clone + Eq + Hash,

Expand the document with the given vocabulary and loader, using the given options and warning handler. Read more
Source§

async 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>
where N: VocabularyMut<Iri = I>, I: 'a + Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

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
where N: VocabularyMut<Iri = I>, I: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Compact the document relative to context with the given vocabulary and loader, using the given options and warning handler. Read more
Source§

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>
where N: VocabularyMut<Iri = I>, I: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Flatten the document with the given vocabulary, generator and loader, using the given options and warning handler. Read more
Source§

async fn compare_with_using<'a, N>( &'a self, other: &'a Self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> CompareResult
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Compare this document against other with a custom vocabulary using the given options. Read more
Source§

async fn compare_with<'a, N>( &'a self, other: &'a Self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> CompareResult
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Compare this document against other with a custom vocabulary. Read more
Source§

async fn compare_using<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, options: Options<Iri>, ) -> CompareResult
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Compare this document against other using the given options. Read more
Source§

async fn compare<'a>( &'a self, other: &'a Self, loader: &'a impl Loader, ) -> CompareResult
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Compare this document against other with a custom vocabulary. Read more
Source§

async fn expand_with_using<'a, N>( &'a self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> ExpandResult<Iri, N::BlankId>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Expand the document with the given vocabulary and loader, using the given options. Read more
Source§

async fn expand_with<'a, N>( &'a self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> ExpandResult<Iri, N::BlankId>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Expand the document with the given vocabulary and loader. Read more
Source§

async fn expand_using<'a>( &'a self, loader: &'a impl Loader, options: Options<Iri>, ) -> ExpandResult<Iri, BlankIdBuf>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Expand the document with the given loader using the given options. Read more
Source§

async fn expand<'a>( &'a self, loader: &'a impl Loader, ) -> ExpandResult<Iri, BlankIdBuf>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Expand the document with the given loader. Read more
Source§

async fn into_document_with_using<'a, N>( self, vocabulary: &'a mut N, loader: &'a impl Loader, options: Options<Iri>, ) -> IntoDocumentResult<Iri, N::BlankId>
where N: VocabularyMut<Iri = Iri>, Iri: 'a + Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Source§

async fn into_document_with<'a, N>( self, vocabulary: &'a mut N, loader: &'a impl Loader, ) -> IntoDocumentResult<Iri, N::BlankId>
where N: VocabularyMut<Iri = Iri>, Iri: 'a + Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Source§

async fn into_document<'a>( self, loader: &'a impl Loader, ) -> IntoDocumentResult<Iri, BlankIdBuf>
where (): VocabularyMut<Iri = Iri>, Iri: 'a + Clone + Eq + Hash,

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
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Compact the document relative to context with the given vocabulary and loader, using the given options. Read more
Source§

async fn compact_with<'a, N>( &'a self, vocabulary: &'a mut N, context: RemoteContextReference<Iri>, loader: &'a impl Loader, ) -> CompactResult
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Compact the document relative to context with the given vocabulary and loader. Read more
Source§

async fn compact_using<'a>( &'a self, context: RemoteContextReference<Iri>, loader: &'a impl Loader, options: Options<Iri>, ) -> CompactResult
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Compact the document relative to context with the given loader, using the given options. Read more
Source§

async fn compact<'a>( &'a self, context: RemoteContextReference<Iri>, loader: &'a impl Loader, ) -> CompactResult
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Compact the document relative to context with the given loader. Read more
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>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Flatten the document with the given vocabulary, generator and loader, using the given options. Read more
Source§

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>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: 'a + Clone + Eq + Hash,

Flatten the document with the given vocabulary, generator and loader. Read more
Source§

async fn flatten_using<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, options: Options<Iri>, ) -> FlattenResult<Iri, BlankIdBuf>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Flatten the document with the given generator, loader and using the given options. Read more
Source§

async fn flatten<'a>( &'a self, generator: &'a mut impl Generator, loader: &'a impl Loader, ) -> FlattenResult<Iri, BlankIdBuf>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash,

Flatten the document with the given generator and loader. Read more
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>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: Clone + Eq + Hash, G: Generator<N>,

Serializes the document into an RDF dataset with a custom vocabulary using the given options and warnings handler. Read more
Source§

async fn to_rdf_with_using<N, G>( &self, vocabulary: N, generator: G, loader: &impl Loader, options: Options<Iri>, ) -> ToRdfResult<N, G>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: Clone + Eq + Hash, G: Generator<N>,

Serializes the document into an RDF dataset with a custom vocabulary using the given options. Read more
Source§

async fn to_rdf_with<N, G>( &self, vocabulary: N, generator: G, loader: &impl Loader, ) -> ToRdfResult<N, G>
where N: VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, N::BlankId: Clone + Eq + Hash, G: Generator<N>,

Serializes the document into an RDF dataset with a custom vocabulary. Read more
Source§

async fn to_rdf_using<G>( &self, generator: G, loader: &impl Loader, options: Options<Iri>, ) -> ToRdfResult<(), G>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, G: Generator,

Serializes the document into an RDF dataset using the given options. Read more
Source§

async fn to_rdf<G>( &self, generator: G, loader: &impl Loader, ) -> ToRdfResult<(), G>
where (): VocabularyMut<Iri = Iri>, Iri: Clone + Eq + Hash, G: Generator,

Serializes the document into an RDF dataset. Read more

Auto Trait Implementations§

§

impl<I, T> Freeze for RemoteDocumentReference<I, T>
where I: Freeze, T: Freeze,

§

impl<I, T> RefUnwindSafe for RemoteDocumentReference<I, T>

§

impl<I, T> Send for RemoteDocumentReference<I, T>
where I: Send, T: Send,

§

impl<I, T> Sync for RemoteDocumentReference<I, T>
where I: Sync, T: Sync,

§

impl<I, T> Unpin for RemoteDocumentReference<I, T>
where I: Unpin, T: Unpin,

§

impl<I, T> UnwindSafe for RemoteDocumentReference<I, T>
where I: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToOwned for T

Source§

type Owned = T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,