[−][src]Struct json_ld::RemoteDocument
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]
fn clone(&self) -> RemoteDocument<D>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<D> Deref for RemoteDocument<D>
[src]
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
fn base_url(&self) -> Option<Iri>
[src]
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,
[src]
&'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<'a, C: Send + Sync + ContextMut<T>, L: Send + Sync + Loader>(
&'a self,
context: &'a C,
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,
[src]
&'a self,
context: &'a C,
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,
Auto Trait Implementations
impl<D> RefUnwindSafe for RemoteDocument<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for RemoteDocument<D> where
D: Send,
D: Send,
impl<D> Sync for RemoteDocument<D> where
D: Sync,
D: Sync,
impl<D> Unpin for RemoteDocument<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for RemoteDocument<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToOwned for T
[src]
type Owned = T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,