pub struct Options {
pub processing_mode: ProcessingMode,
pub override_protected: bool,
pub propagate: bool,
pub vocab: Action,
}Expand description
Options of the context processing algorithm.
Fields§
§processing_mode: ProcessingModeWhich version of JSON-LD to enforce.
Under ProcessingMode::JsonLd1_0 the 1.1 additions — @import,
@propagate, @direction, @protected, @nest, @prefix, scoped
contexts, document-relative @vocab, and the @graph/@id/@type
containers — are rejected rather than honoured.
override_protected: boolWhether this context may redefine terms marked @protected.
Set for a scoped context, which is allowed to replace the definitions of the context it is scoped within.
propagate: boolWhether the processed context stays in effect for nested node objects.
When false, the context in force before processing is retained as the
result’s previous context and restored on descending into a new node
object. This is what limits a type-scoped context to the node it was
introduced on.
vocab: ActionWhat to do when a term has to be expanded through the vocabulary mapping.
The default, Action::Keep, is the specified behaviour.
Action::Drop and Action::Reject let a caller refuse terms that
only resolve because of @vocab, which is useful for validating that a
document’s context covers every term it uses.
Implementations§
Source§impl Options
impl Options
Sourcepub fn with_override(&self) -> Options
pub fn with_override(&self) -> Options
Returns these options with override_protected set to true.
Sourcepub fn with_no_override(&self) -> Options
pub fn with_no_override(&self) -> Options
Returns these options with override_protected set to false.
Sourcepub fn without_propagation(&self) -> Options
pub fn without_propagation(&self) -> Options
Returns these options with propagate set to false.
Trait Implementations§
impl Copy for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self is equivalent to key.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.