pub struct SimpleContext {
pub import: Option<String>,
pub type_: Option<TypeOrVec>,
pub version: Option<String>,
pub base: Option<Option<String>>,
pub vocab: Option<Option<String>>,
pub language: Option<Option<String>>,
pub direction: Option<String>,
pub protected: Option<bool>,
pub terms: IndexMap<String, TermDef>,
}Expand description
Defines the structure of an inline JSON-LD @context object, supporting:
- reserved context keywords (e.g.,
@base,@vocab,@protected) - term mappings for expanding compact keys to IRIs or more detailed definitions
Most reserved keywords are optional.
Doubly-Option fields (e.g., Option<Option<String>>) allow distinguishing between
omitted, null, or non-null values when serializing.
Fields§
§import: Option<String>@import: Import external context definition (JSON-LD 1.1 feature).
type_: Option<TypeOrVec>@type: The type of the context object.
version: Option<String>@version: Indicates the JSON-LD version this context targets.
base: Option<Option<String>>@base: The default base IRI; Some(None) serializes to null (explicitly clear).
vocab: Option<Option<String>>@vocab: The default vocabulary IRI; Some(None) outputs null for explicit clearing.
language: Option<Option<String>>@language: Default language code. Some(None) serializes as null.
direction: Option<String>@direction: Base direction for string values (“ltr” or “rtl”).
protected: Option<bool>@protected: When true, marks all term definitions in this context as protected.
terms: IndexMap<String, TermDef>Key-value term definitions (mappings or detailed definitions for context terms).
Implementations§
Source§impl SimpleContext
impl SimpleContext
Sourcepub fn ensure_v11(self) -> Self
pub fn ensure_v11(self) -> Self
Ensures the inline context explicitly contains @version: 1.1.
Returns self for fluent usage.
Trait Implementations§
Source§impl Clone for SimpleContext
impl Clone for SimpleContext
Source§fn clone(&self) -> SimpleContext
fn clone(&self) -> SimpleContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimpleContext
impl Debug for SimpleContext
Source§impl Default for SimpleContext
impl Default for SimpleContext
Source§fn default() -> SimpleContext
fn default() -> SimpleContext
Source§impl<'de> Deserialize<'de> for SimpleContext
impl<'de> Deserialize<'de> for SimpleContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SimpleContext
impl PartialEq for SimpleContext
Source§impl Serialize for SimpleContext
impl Serialize for SimpleContext
impl Eq for SimpleContext
impl StructuralPartialEq for SimpleContext
Auto Trait Implementations§
impl Freeze for SimpleContext
impl RefUnwindSafe for SimpleContext
impl Send for SimpleContext
impl Sync for SimpleContext
impl Unpin for SimpleContext
impl UnsafeUnpin for SimpleContext
impl UnwindSafe for SimpleContext
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> 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§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.