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
A Remote document is a document.
type LocalContext = D::LocalContext
type LocalContext = D::LocalContext
The type of local contexts that may appear in the document. Read more
fn expand_with<'a, C: Send + Sync + ContextMut<T>, L: Send + Sync + Loader>(
&'a self,
base_url: Option<Iri<'_>>,
context: &'a C,
loader: &'a mut L,
options: Options
) -> BoxFuture<'a, Result<ExpandedDocument<T>, Error>> where
C::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Send + Sync,
fn expand_with<'a, C: Send + Sync + ContextMut<T>, L: Send + Sync + Loader>(
&'a self,
base_url: Option<Iri<'_>>,
context: &'a C,
loader: &'a mut L,
options: Options
) -> BoxFuture<'a, Result<ExpandedDocument<T>, Error>> where
C::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Send + Sync,
Expand the document with a custom base URL, initial context, document loader and expansion options. Read more
fn expand<'a, C: 'a + Send + Sync + ContextMut<T>, L: Send + Sync + Loader>(
&'a self,
loader: &'a mut L
) -> BoxFuture<'a, Result<ExpandedDocument<T>, Error>> where
C::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Send + Sync,
Self: Sync,
fn expand<'a, C: 'a + Send + Sync + ContextMut<T>, L: Send + Sync + Loader>(
&'a self,
loader: &'a mut L
) -> BoxFuture<'a, Result<ExpandedDocument<T>, Error>> where
C::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Send + Sync,
Self: Sync,
Expand the document. Read more
fn compact_with<'a, C: ContextMutProxy<T> + Send + Sync + AsJson, L: Send + Sync + Loader>(
&'a self,
base_url: Option<Iri<'a>>,
context: &'a C,
loader: &'a mut L,
options: Options
) -> BoxFuture<'a, Result<JsonValue, Error>> where
C::Target: Send + Sync + Default,
<C::Target as Context<T>>::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Send + Sync,
Self: Sync,
fn compact<'a, C: ContextMutProxy<T> + Send + Sync + AsJson, L: Send + Sync + Loader>(
&'a self,
context: &'a C,
loader: &'a mut L
) -> BoxFuture<'a, Result<JsonValue, Error>> where
C::Target: Send + Sync + Default,
<C::Target as Context<T>>::LocalContext: Send + Sync + From<L::Output> + From<Self::LocalContext>,
L::Output: Into<Self::LocalContext>,
T: 'a + Id + Send + Sync,
Self: Sync,
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
Mutably borrows from an owned value. Read more