pub struct RemoteDocument<D> { /* private fields */ }
Expand description

Remote JSON-LD document.

Represent a document located at a given base URL. This is the result of loading a document with Loader::load. It is a simple wrapper that Deref to the underlying document while remembering its base URL.

Example

use static_iref::*;

use async_std::task;
use serde_json::Value;
use json_ld::{
  Loader,
  FsLoader,
  RemoteDocument
};

// Prepare the loader.
let mut loader = FsLoader::<Value>::new(|s| serde_json::from_str(s));
loader.mount(iri!("https://w3c.github.io/json-ld-api"), "json-ld-api");

// Load the remote document.
let url = iri!("https://w3c.github.io/json-ld-api/tests/expand-manifest.jsonld");
let doc: RemoteDocument<Value> = task::block_on(loader.load(url)).unwrap();

Implementations

Create a new remote document from the document contents and base URL.

Consume the remote document and return the inner document.

Consume the remote document and return the inner document along with its base URL.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

A Remote document is a document.

Document location, if any.

Expand the document with a custom base URL, initial context, document loader and expansion options. Read more

Expand the document. Read more

Compact the document with a custom base URL, context, document loader and options. Read more

Compact the document.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.