[][src]Struct json_ld::RemoteDocument

pub struct RemoteDocument<D = JsonValue> { /* fields omitted */ }

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

#[macro_use]
extern crate static_iref;

use std_async::task;
use json_ld::FsLoader;

let mut loader = FsLoader::new();
loader.mount(iri!("https://w3c.github.io/json-ld-api"), "json-ld-api");

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();

Methods

impl<D> RemoteDocument<D>[src]

pub fn new(doc: D, base_url: Iri) -> RemoteDocument<D>[src]

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

pub fn into_document(self) -> D[src]

Consume the remote document and return the inner document.

pub fn into_parts(self) -> (D, IriBuf)[src]

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

Trait Implementations

impl<D: Clone> Clone for RemoteDocument<D>[src]

impl<D> Deref for RemoteDocument<D>[src]

type Target = D

The resulting type after dereferencing.

impl<D> DerefMut for RemoteDocument<D>[src]

impl<T: Id, D: Document<T>> Document<T> for RemoteDocument<D>[src]

A Remote document is a document.

type LocalContext = D::LocalContext

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

Auto Trait Implementations

impl<D> RefUnwindSafe for RemoteDocument<D> where
    D: RefUnwindSafe

impl<D> Send for RemoteDocument<D> where
    D: Send

impl<D> Sync for RemoteDocument<D> where
    D: Sync

impl<D> Unpin for RemoteDocument<D> where
    D: Unpin

impl<D> UnwindSafe for RemoteDocument<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToOwned for T[src]

type Owned = T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.