json_ld/algorithms/context_processing/
options.rs1use crate::JsonLdProcessingMode;
2
3#[derive(Clone, Copy, PartialEq, Eq)]
5pub struct JsonLdContextProcessingOptions {
6 pub processing_mode: JsonLdProcessingMode,
8
9 pub override_protected: bool,
11
12 pub propagate: bool,
14}
15
16impl JsonLdContextProcessingOptions {
17 #[must_use]
19 pub fn with_override(&self) -> JsonLdContextProcessingOptions {
20 let mut opt = *self;
21 opt.override_protected = true;
22 opt
23 }
24
25 #[must_use]
27 pub fn with_no_override(&self) -> JsonLdContextProcessingOptions {
28 let mut opt = *self;
29 opt.override_protected = false;
30 opt
31 }
32
33 #[must_use]
35 pub fn without_propagation(&self) -> JsonLdContextProcessingOptions {
36 let mut opt = *self;
37 opt.propagate = false;
38 opt
39 }
40}
41
42impl Default for JsonLdContextProcessingOptions {
43 fn default() -> JsonLdContextProcessingOptions {
44 JsonLdContextProcessingOptions {
45 processing_mode: JsonLdProcessingMode::default(),
46 override_protected: false,
47 propagate: true,
48 }
49 }
50}