Skip to main content

Definition

Struct Definition 

Source
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: Bindings

Term definitions of this context.

Implementations§

Source§

impl Definition

Source

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

Source

pub fn new() -> Self

Creates an empty context definition, with no entry set.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Definition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Definition

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Definition

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Definition

Source§

impl From<Definition> for Context

Source§

fn from(c: Definition) -> Self

Converts to this type from the input type.
Source§

impl From<Definition> for ContextEntry

Source§

fn from(c: Definition) -> Self

Converts to this type from the input type.
Source§

impl IntoJson for Definition

Source§

fn into_json(self) -> Value

Converts this value into JSON.
Source§

impl PartialEq for Definition

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Definition

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Definition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowUnordered for T

Source§

fn as_unordered(&self) -> &Unordered<T>

Views this value as an Unordered reference.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if self is equivalent to key.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = !

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>
where T: Sized,