pub struct Definition {
pub base: Option<Nullable<IriRefBuf>>,
pub import: Option<IriRefBuf>,
pub language: Option<Nullable<LenientLangTagBuf>>,
pub direction: Option<Nullable<Direction>>,
pub propagate: Option<bool>,
pub protected: Option<bool>,
pub type_: Option<Type>,
pub version: Option<Version>,
pub vocab: Option<Nullable<Vocab>>,
pub bindings: Bindings,
}Expand description
Context definition: the object form of a context entry.
Holds the keyword entries a context may set (@base, @vocab, …) and the
term definitions it binds.
Fields§
§base: Option<Nullable<IriRefBuf>>The @base entry, setting the base IRI against which relative IRIs are resolved.
import: Option<IriRefBuf>The @import entry, referencing a context to merge into this one.
language: Option<Nullable<LenientLangTagBuf>>The @language entry, tagging string values with a language.
direction: Option<Nullable<Direction>>The @direction entry, setting the base direction of string values.
propagate: Option<bool>The @propagate entry, controlling whether the context survives into node objects.
protected: Option<bool>The @protected entry, forbidding redefinition of the terms defined here.
type_: Option<Type>The @type entry, setting how the node types of the described documents
are laid out and whether that setting is protected.
version: Option<Version>The @version entry, declaring the processing mode.
vocab: Option<Nullable<Vocab>>The @vocab entry, setting the vocabulary against which terms expand.
bindings: BindingsTerm definitions of this context.
Implementations§
Source§impl Definition
impl Definition
Sourcepub fn iter(&self) -> Entries<'_> ⓘ
pub fn iter(&self) -> Entries<'_> ⓘ
Returns an iterator over the entries of this context definition.
The keyword entries come first, in the order they are declared on
Definition, followed by the term bindings in insertion order.
Source§impl Definition
impl Definition
Sourcepub fn get(&self, key: &KeyOrKeyword) -> Option<EntryValueRef<'_>>
pub fn get(&self, key: &KeyOrKeyword) -> Option<EntryValueRef<'_>>
Returns the value of the entry with the given key, if that entry is set.
The key may name a keyword entry or a term binding. Keywords that a
context definition cannot hold, such as @id, always yield None.
Sourcepub fn get_binding(&self, key: &Key) -> Option<Nullable<&TermDefinition>>
pub fn get_binding(&self, key: &Key) -> Option<Nullable<&TermDefinition>>
Returns the term definition bound to the given term, if any.
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§impl Debug for Definition
impl Debug for Definition
Source§impl Default for Definition
impl Default for Definition
Source§impl<'de> Deserialize<'de> for Definition
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Definition
serde only.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>,
impl Eq for Definition
Source§impl From<Definition> for Context
impl From<Definition> for Context
Source§fn from(c: Definition) -> Self
fn from(c: Definition) -> Self
Source§impl From<Definition> for ContextEntry
impl From<Definition> for ContextEntry
Source§fn from(c: Definition) -> Self
fn from(c: Definition) -> Self
Source§impl PartialEq for Definition
impl PartialEq for Definition
Source§impl Serialize for Definition
Available on crate feature serde only.
impl Serialize for Definition
serde only.impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.