Struct json_ns::TargetContext [−][src]
Structure holding the target context to reword a document to.
An instance of this struct is part of the Processor
, which can be modified to provide rules
according to which the output will be reworded.
By default, this context is empty, which will result in an output document containing only absolute IRIs.
Fields
rules: Vec<(String, String)>
Pairs of CURIE prefixes and their respective base IRIs.
For absolute IRIs that are about to be added to the output document, the processor will try to find a matching prefix in this list. If found, a CURIE will be used instead.
This list may also contain an entry with an empty string prefix, which then represents the default namespace of the output document.
Methods
impl TargetContext
[src]
impl TargetContext
pub fn new() -> TargetContext
[src]
pub fn new() -> TargetContext
Alias for TargetContext::default()
.
pub fn add_rule(&mut self, prefix: &str, base: &str) -> &mut Self
[src]
pub fn add_rule(&mut self, prefix: &str, base: &str) -> &mut Self
A short-hand for adding a rule.
pub fn compact_iri<'a>(&self, iri: &'a str) -> Cow<'a, str>
[src]
pub fn compact_iri<'a>(&self, iri: &'a str) -> Cow<'a, str>
Compact an absolute IRI according to this context.
Trait Implementations
impl Clone for TargetContext
[src]
impl Clone for TargetContext
fn clone(&self) -> TargetContext
[src]
fn clone(&self) -> TargetContext
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for TargetContext
[src]
impl Debug for TargetContext
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for TargetContext
[src]
impl Default for TargetContext
fn default() -> TargetContext
[src]
fn default() -> TargetContext
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for TargetContext
impl Send for TargetContext
impl Sync for TargetContext
impl Sync for TargetContext