Struct json_ns::Processor [−][src]
pub struct Processor { pub context: Context, pub target: TargetContext, }
A document processor.
This structure holds configuration for processing documents. The defaults are fine if the
output document should contain only absolute IRIs, but usually you want to set some namespaces
for the output document in the TargetContext
contained within.
Fields
context: Context
External context added to the document. Defaults to an empty context, so only inline contexts in the document itself are used.
target: TargetContext
Target context to reword the document to. Defaults to an empty context, so the result will contain only absolute IRIs for all properties and types.
Methods
impl Processor
[src]
impl Processor
pub fn new() -> Processor
[src]
pub fn new() -> Processor
Alias for Processor::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 to the contained TargetContext
.
pub fn process_value(&self, value: &Value) -> Value
[src]
pub fn process_value(&self, value: &Value) -> Value
Process a value, using the configuration in this struct.
pub fn process_object(&self, object: &Map<String, Value>) -> Map<String, Value>
[src]
pub fn process_object(&self, object: &Map<String, Value>) -> Map<String, Value>
Process an object, using the configuration in this struct.
Trait Implementations
impl Clone for Processor
[src]
impl Clone for Processor
fn clone(&self) -> Processor
[src]
fn clone(&self) -> Processor
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 Processor
[src]
impl Debug for Processor
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 Processor
[src]
impl Default for Processor