Struct json_ld::RemoteDocument[][src]

pub struct RemoteDocument<D = JsonValue> { /* fields omitted */ }
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 json::JsonValue;
use json_ld::{
  Loader,
  FsLoader,
  RemoteDocument
};

// Prepare the loader.
let mut loader = FsLoader::new();
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<JsonValue> = 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.

The type of local contexts that may appear in the document. Read more

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

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)

recently added

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.