Struct json_ns::Context[][src]

pub struct Context {
    pub ns: Option<String>,
    pub lang: String,
    pub prefixes: BTreeMap<String, String>,
    pub aliases: BTreeMap<String, String>,
    pub container: BTreeMap<String, String>,
}

Structure holding the current context to interpret a document with.

An instance of this struct is part of the Processor, which can be modified to provide an external context to interpret documents with. Such a custom context can also be created from JSON using one of the From implementations.

Fields

The default namespace, for properties that are not a keyword, CURIE, or IRI.

The Default language for internationalised properties that don't specify one. The empty string when not defined.

Map of defined CURIE prefixes to their base IRIs.

Map of defined aliases by their literal property names.

Map of defined container mappings by their literal property names.

Methods

impl Context
[src]

An alias for Context::default().

Merge an @context value into this structure.

Merge an @context object into this structure.

Expand a name according to this context.

A name may be an absolute IRI, a CURIE within a defined namespace, or a name in the default namespace, otherwise None is returned (and the property or value should be dropped).

Trait Implementations

impl Clone for Context
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Context
[src]

Formats the value using the given formatter. Read more

impl Default for Context
[src]

Returns the "default value" for a type. Read more

impl<'a> From<&'a Value> for Context
[src]

Performs the conversion.

impl<'a> From<&'a Map<String, Value>> for Context
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Context

impl Sync for Context