Skip to main content

NormalTermDefinition

Struct NormalTermDefinition 

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

Whether the term may expand compact IRIs.

§protected: bool

Whether the term is protected against redefinition.

§reverse_property: bool

Whether 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: Container

Container 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>

Source

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.

Source

pub fn base_url(&self) -> Option<&T>

Returns the base URL used to resolve relative IRIs of the term.

Source

pub fn value(&self) -> Option<&Term<T, B>>

IRI mapping as a Term reference, transparent to the Arc wrapper.

Source

pub fn value_arc(&self) -> Option<&Arc<Term<T, B>>>

Cheap-clonable handle to the IRI mapping.

Source

pub fn into_syntax_definition( self, vocabulary: &impl Vocabulary<Iri = T, BlankId = B>, ) -> Result<Nullable<TermDefinition>, InvalidContextError>
where T: Clone, B: Clone,

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: Clone, B: Clone> Clone for NormalTermDefinition<T, B>

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<T, B> Default for NormalTermDefinition<T, B>

Source§

fn default() -> NormalTermDefinition<T, B>

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

impl<T: Eq, B: Eq> Eq for NormalTermDefinition<T, B>

Source§

impl<T: PartialEq, B: PartialEq> PartialEq for NormalTermDefinition<T, B>

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<T: PartialEq, B: PartialEq> StructuralPartialEq for NormalTermDefinition<T, B>

Auto Trait Implementations§

§

impl<T, B> Freeze for NormalTermDefinition<T, B>
where Option<Arc<Term<T, B>>>: Freeze, Option<T>: Freeze, Option<Type<T>>: Freeze,

§

impl<T, B> RefUnwindSafe for NormalTermDefinition<T, B>

§

impl<T, B> Send for NormalTermDefinition<T, B>
where Option<Arc<Term<T, B>>>: Send, Option<T>: Send, Option<Type<T>>: Send,

§

impl<T, B> Sync for NormalTermDefinition<T, B>
where Option<Arc<Term<T, B>>>: Sync, Option<T>: Sync, Option<Type<T>>: Sync,

§

impl<T, B> Unpin for NormalTermDefinition<T, B>
where Option<Arc<Term<T, B>>>: Unpin, Option<T>: Unpin, Option<Type<T>>: Unpin,

§

impl<T, B> UnsafeUnpin for NormalTermDefinition<T, B>

§

impl<T, B> UnwindSafe for NormalTermDefinition<T, B>

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<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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more