pub struct ContextLoader { /* private fields */ }

Implementations§

source§

impl ContextLoader

source

pub fn empty() -> Self

Constructs an “empty” ContextLoader.

source

pub fn with_static_loader(self) -> Self

Using the builder pattern, the StaticLoader can be enabled so that contexts are checked against it before being checked against context_map.

source

pub fn with_context_map_from( self, preparsed_context_map: HashMap<String, String> ) -> Result<Self, FromContextMapError>

Using the builder pattern, the map of additional contexts can be set. These context objects will be checked after StaticLoader (if it’s specified). preparsed_context_map should map the context URLs to their JSON content.

Trait Implementations§

source§

impl Clone for ContextLoader

source§

fn clone(&self) -> ContextLoader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ContextLoader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for ContextLoader

The default ContextLoader only uses StaticLoader.

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Loader<IriBuf, Span> for ContextLoader

§

type Output = Value<Span>

The type of documents that can be loaded.
§

type Error = UnknownContext

Error type.
source§

fn load_with<'a>( &'a mut self, _vocabulary: &'a mut impl Sync + Send + IriVocabularyMut<Iri = IriBuf>, url: IriBuf ) -> BoxFuture<'a, LoadingResult<IriBuf, Span, Self::Output, Self::Error>>where IriBuf: 'a,

Loads the document behind the given IRI, using the given vocabulary.
§

fn load<'a>( &'a mut self, url: I ) -> Pin<Box<dyn Future<Output = Result<RemoteDocument<I, M, Self::Output>, Self::Error>> + Send + 'a, Global>>where I: 'a, (): IriVocabulary<Iri = I>,

Loads the document behind the given IRI.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> At for T

source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowStripped for T

source§

fn stripped(&self) -> &Stripped<T>

source§

impl<T> BorrowUnordered for T

source§

fn unordered(&self) -> &Unordered<T>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, C> FromWithContext<T, C> for T

§

fn from_with(value: T, _context: &C) -> T

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U, C> IntoWithContext<U, C> for Twhere U: FromWithContext<T, C>,

§

fn into_with(self, context: &C) -> U

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToOwned for T

§

type Owned = T

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U, C> TryFromWithContext<U, C> for Twhere U: IntoWithContext<T, C>,

§

type Error = Infallible

§

fn try_from_with( value: U, context: &C ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U, C> TryIntoWithContext<U, C> for Twhere U: TryFromWithContext<T, C>,

§

type Error = <U as TryFromWithContext<T, C>>::Error

§

fn try_into_with( self, context: &C ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

§

impl<T> WithContext for Twhere T: ?Sized,

§

fn with<C>(&self, context: C) -> Contextual<&T, C>

§

fn into_with<C>(self, context: C) -> Contextual<T, C>