Skip to main content

StaticDomain

Struct StaticDomain 

Source
pub struct StaticDomain<R>(/* private fields */);
Expand description

Trivial domain implementation that just fixes the resource type R, without tracking any actual resource.

Useful whenever a Domain is required by a trait bound but no domain-specific behavior (finiteness, generation, etc.) is needed, or as a default/building block for other, more specific domains.

Implementations§

Source§

impl<R> StaticDomain<R>

Source

pub fn new() -> StaticDomain<R>

Creates a new static domain.

Trait Implementations§

Source§

impl<R> Default for StaticDomain<R>

Source§

fn default() -> StaticDomain<R>

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

impl<R> Domain for StaticDomain<R>

Source§

type Resource = R

Resource type.
Source§

impl GroundInterpretation for StaticDomain<Term>

Source§

fn iri(&self, iri: &Iri) -> Option<Term>

Interprets the given IRI, if possible.
Source§

fn literal<'a>(&self, literal: impl Into<LiteralRef<'a>>) -> Option<Term>

Interprets the given literal, if possible.
Source§

fn ground_term<'a>( &self, term: impl Into<GroundTermRef<'a>>, ) -> Option<Self::Resource>

Interprets the given ground term (an IRI or a literal), if possible.
Source§

impl GroundInterpretationMut for StaticDomain<Term>

Source§

fn insert_iri<'a>(&mut self, iri: impl Into<Cow<'a, Iri>>) -> Self::Resource

Interprets the given IRI, inserting a fresh resource for it if none exists yet.
Source§

fn insert_literal<'a>( &mut self, literal: impl Into<CowLiteral<'a>>, ) -> Self::Resource

Interprets the given literal, inserting a fresh resource for it if none exists yet.
Source§

fn insert_ground_term<'a>( &mut self, term: impl Into<CowGroundTerm<'a>>, ) -> Self::Resource

Interprets the given ground term, inserting a fresh resource for it if none exists yet.
Source§

impl ReverseGroundInterpretation for StaticDomain<Term>

Source§

type Iris<'a> = IntoIter<&'a Iri>

Iterator over the IRIs of a resource.
Source§

type Literals<'a> = IntoIter<LiteralRef<'a>>

Iterator over the literals of a resource.
Source§

fn iris_of<'a>(&'a self, resource: &'a Self::Resource) -> Self::Iris<'a>

Returns an iterator over the IRIs of resource.
Source§

fn literals_of<'a>(&'a self, resource: &'a Self::Resource) -> Self::Literals<'a>

Returns an iterator over the literals of resource.
Source§

fn ground_terms_of<'a>( &'a self, resource: &'a Self::Resource, ) -> GroundTermsOf<'a, Self>

Returns an iterator over the ground terms (IRIs and literals) of resource.
Source§

fn is_anonymous(&self, resource: &Self::Resource) -> bool

Checks whether resource has no ground term lexical representation.

Auto Trait Implementations§

§

impl<R> Freeze for StaticDomain<R>

§

impl<R> RefUnwindSafe for StaticDomain<R>
where R: RefUnwindSafe,

§

impl<R> Send for StaticDomain<R>
where R: Send,

§

impl<R> Sync for StaticDomain<R>
where R: Sync,

§

impl<R> Unpin for StaticDomain<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for StaticDomain<R>

§

impl<R> UnwindSafe for StaticDomain<R>
where R: UnwindSafe,

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<I> TryDomain for I
where I: Domain,

Source§

type Error = Infallible

Error type.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<I> TryGroundInterpretation for I

Source§

type Error = Infallible

Error type.
Source§

fn try_iri( &self, iri: &Iri, ) -> Result<Option<<I as Domain>::Resource>, <I as TryGroundInterpretation>::Error>

Interprets the given IRI, if possible.
Source§

fn try_literal<'a>( &self, literal: impl Into<LiteralRef<'a>>, ) -> Result<Option<<I as Domain>::Resource>, <I as TryGroundInterpretation>::Error>

Interprets the given literal, if possible.
Source§

fn try_ground_term<'a>( &self, term: impl Into<GroundTermRef<'a>>, ) -> Result<Option<<I as Domain>::Resource>, <I as TryGroundInterpretation>::Error>

Interprets the given ground term (an IRI or a literal), if possible.
Source§

impl<I> TryGroundInterpretationMut for I

Source§

fn try_insert_iri<'a>( &mut self, iri: impl Into<Cow<'a, Iri>>, ) -> Result<<I as Domain>::Resource, <I as TryGroundInterpretation>::Error>

Interprets the given IRI, inserting a fresh resource for it if none exists yet.
Source§

fn try_insert_literal<'a>( &mut self, literal: impl Into<CowLiteral<'a>>, ) -> Result<<I as Domain>::Resource, <I as TryGroundInterpretation>::Error>

Interprets the given literal, inserting a fresh resource for it if none exists yet.
Source§

fn try_insert_ground_term<'a>( &mut self, term: impl Into<CowGroundTerm<'a>>, ) -> Result<<I as Domain>::Resource, <I as TryGroundInterpretation>::Error>

Interprets the given ground term, inserting a fresh resource for it if none exists yet.
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<I> TryReverseGroundInterpretation for I

Source§

type TryIris<'a> = InfallibleIterator<MapIntoOwned<<I as ReverseGroundInterpretation>::Iris<'a>>> where I: 'a

Iterator over the IRIs of a resource.
Source§

type TryLiterals<'a> = InfallibleIterator<MapIntoOwned<<I as ReverseGroundInterpretation>::Literals<'a>>> where I: 'a

Iterator over the literals of a resource.
Source§

fn try_iris_of<'a>( &'a self, resource: &'a <I as Domain>::Resource, ) -> Result<<I as TryReverseGroundInterpretation>::TryIris<'a>, <I as TryGroundInterpretation>::Error>

Returns an iterator over the IRIs of resource.
Source§

fn try_literals_of<'a>( &'a self, resource: &'a <I as Domain>::Resource, ) -> Result<<I as TryReverseGroundInterpretation>::TryLiterals<'a>, <I as TryGroundInterpretation>::Error>

Returns an iterator over the literals of resource.
Source§

fn try_is_anonymous( &self, resource: &<I as Domain>::Resource, ) -> Result<bool, <I as TryGroundInterpretation>::Error>

Checks whether resource has no ground term lexical representation.
Source§

fn try_ground_terms_of<'a>( &'a self, resource: &'a Self::Resource, ) -> Result<TryGroundTermsOf<'a, Self>, Self::Error>

Returns an iterator over the ground terms (IRIs and literals) of resource.