pub struct NormalTermDefinition<T = IriBuf, B = BlankIdBuf> {
pub value: Option<Arc<Term<T, B>>>,
pub prefix: bool,
pub protected: bool,
pub reverse_property: bool,
pub base_url: Option<T>,
pub context: Option<Box<Context>>,
pub container: Container,
pub direction: Option<Nullable<Direction>>,
pub index: Option<Index>,
pub language: Option<Nullable<LenientLangTagBuf>>,
pub nest: Option<Nest>,
pub typ: Option<Type<T>>,
}Expand description
Definition of an ordinary term, as processed from a context.
Fields§
§value: Option<Arc<Term<T, B>>>Term the definition maps to.
Wrapped in Arc so the per-element-per-property hot path in
expand_iri_simple returns a refcount bump instead of deep-cloning the
(potentially IriBuf-backed) term. Prefer the value() /
value_arc() accessors over direct field access.
prefix: boolWhether the term may expand compact IRIs.
protected: boolWhether the term is protected against redefinition.
reverse_property: boolWhether the term denotes a reverse property.
base_url: Option<T>Base URL used to resolve relative IRIs of the term.
context: Option<Box<Context>>Context local to the term.
container: ContainerContainer mapping of the term.
direction: Option<Nullable<Direction>>Base direction of the term’s string values.
index: Option<Index>Index mapping of the term.
language: Option<Nullable<LenientLangTagBuf>>Default language of the term’s string values.
nest: Option<Nest>Nesting term the property is gathered under.
typ: Option<Type<T>>Type mapping of the term.
Implementations§
Source§impl<T, B> NormalTermDefinition<T, B>
impl<T, B> NormalTermDefinition<T, B>
Sourcepub fn modulo_protected_field(&self) -> ModuloProtected<&Self>
pub fn modulo_protected_field(&self) -> ModuloProtected<&Self>
Wraps this definition so that comparisons ignore the @protected
flag, as required when checking whether a redefinition of a protected
term actually changes it.
Sourcepub fn base_url(&self) -> Option<&T>
pub fn base_url(&self) -> Option<&T>
Returns the base URL used to resolve relative IRIs of the term.
Sourcepub fn value(&self) -> Option<&Term<T, B>>
pub fn value(&self) -> Option<&Term<T, B>>
IRI mapping as a Term reference, transparent to the Arc wrapper.
Sourcepub fn into_syntax_definition(
self,
vocabulary: &impl Vocabulary<Iri = T, BlankId = B>,
) -> Result<Nullable<TermDefinition>, InvalidContextError>
pub fn into_syntax_definition( self, vocabulary: &impl Vocabulary<Iri = T, BlankId = B>, ) -> Result<Nullable<TermDefinition>, InvalidContextError>
Consumes this NormalTermDefinition, returning its syntax definition.
§Errors
Returns an error when a term in the context cannot be represented in syntax form, which happens if the vocabulary has no IRI for an identifier it holds.
Trait Implementations§
Source§impl<T, B> Default for NormalTermDefinition<T, B>
impl<T, B> Default for NormalTermDefinition<T, B>
Source§fn default() -> NormalTermDefinition<T, B>
fn default() -> NormalTermDefinition<T, B>
impl<T: Eq, B: Eq> Eq for NormalTermDefinition<T, B>
impl<T: PartialEq, B: PartialEq> StructuralPartialEq for NormalTermDefinition<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for NormalTermDefinition<T, B>
impl<T, B> RefUnwindSafe for NormalTermDefinition<T, B>where
Option<Arc<Term<T, B>>>: RefUnwindSafe,
Option<T>: RefUnwindSafe,
Option<Type<T>>: RefUnwindSafe,
impl<T, B> Send for NormalTermDefinition<T, B>
impl<T, B> Sync for NormalTermDefinition<T, B>
impl<T, B> Unpin for NormalTermDefinition<T, B>
impl<T, B> UnsafeUnpin for NormalTermDefinition<T, B>
impl<T, B> UnwindSafe for NormalTermDefinition<T, B>
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.