Struct json_ld::Options

source ·
pub struct Options<I = Index, M = Location<I>, C = Value<M>> {
    pub base: Option<I>,
    pub compact_arrays: bool,
    pub compact_to_relative: bool,
    pub expand_context: Option<RemoteDocumentReference<I, M, C>>,
    pub ordered: bool,
    pub processing_mode: ProcessingMode,
}
Expand description

JSON-LD Processor options.

Fields§

§base: Option<I>

The base IRI to use when expanding or compacting the document.

If set, this overrides the input document’s IRI.

§compact_arrays: bool

If set to true, the JSON-LD processor replaces arrays with just one element with that element during compaction.

If set to false, all arrays will remain arrays even if they have just one element.

Defaults to true.

§compact_to_relative: bool

Determines if IRIs are compacted relative to the base option or document location when compacting.

Defaults to true.

§expand_context: Option<RemoteDocumentReference<I, M, C>>

A context that is used to initialize the active context when expanding a document.

§ordered: bool

If set to true, certain algorithm processing steps where indicated are ordered lexicographically.

If false, order is not considered in processing.

Defaults to false.

§processing_mode: ProcessingMode

Sets the processing mode.

Defaults to ProcessingMode::JsonLd1_1.

Implementations§

Returns these options with the ordered flag set to false.

This means entries will not be ordered by keys before being processed.

Builds options for the context processing algorithm from these options.

Builds options for the expansion algorithm from these options.

Builds options for the compaction algorithm from these options.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Wraps self inside a Meta<Self, M> using the given metadata. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.