Skip to main content

GenInterpretation

Struct GenInterpretation 

Source
pub struct GenInterpretation<G>(/* private fields */);
Expand description

Lexical interpretation based on a term generator.

Implementations§

Source§

impl<G> GenInterpretation<G>

Source

pub fn new(generator: G) -> Self

Creates a new interpretation from the given term generator.

Source

pub fn into_generator(self) -> G

Discards the interpretation, returning the inner generator.

Trait Implementations§

Source§

impl<G: Generator> ConstGenDomain for GenInterpretation<G>

Source§

fn new_resource(&self) -> Self::Resource

Create a new resource.
Source§

impl<G> Domain for GenInterpretation<G>

Source§

type Resource = Term

Resource type.
Source§

impl<G> GroundInterpretation for GenInterpretation<G>

Source§

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

Interprets the given IRI, if possible.
Source§

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

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<G> GroundInterpretationMut for GenInterpretation<G>

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<G> Interpretation for GenInterpretation<G>

Source§

fn blank_id(&self, blank_id: &BlankId) -> Option<Self::Resource>

Interprets the given blank node identifier, if possible.
Source§

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

Interprets the given term (a blank node identifier or a ground term), if possible.
Source§

fn id<'a>(&self, id: impl Into<IdRef<'a>>) -> Option<Self::Resource>

Interprets the given identifier (a blank node identifier or an IRI), if possible.
Source§

impl<G> InterpretationMut for GenInterpretation<G>

Source§

fn insert_blank_id<'a>( &mut self, blank_id: impl Into<Cow<'a, BlankId>>, ) -> Self::Resource

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

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

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

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

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

impl<G> ReverseGroundInterpretation for GenInterpretation<G>

Source§

type Iris<'a> = IntoIter<&'a Iri> where Self: 'a

Iterator over the IRIs of a resource.
Source§

type Literals<'a> = IntoIter<LiteralRef<'a>> where Self: '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.
Source§

impl<G> ReverseInterpretation for GenInterpretation<G>

Source§

type BlankIds<'a> = IntoIter<&'a BlankId> where Self: 'a

Iterator over the blank node identifiers of a resource.
Source§

fn blank_ids_of<'a>( &'a self, resource: &'a Self::Resource, ) -> Self::BlankIds<'a>

Returns an iterator over the blank node identifiers of resource.
Source§

fn terms_of<'a>(&'a self, resource: &'a Self::Resource) -> TermsOf<'a, Self>

Returns an iterator over the terms (ground terms and blank node identifiers) of resource.

Auto Trait Implementations§

§

impl<G> !Freeze for GenInterpretation<G>

§

impl<G> !RefUnwindSafe for GenInterpretation<G>

§

impl<G> !Sync for GenInterpretation<G>

§

impl<G> Send for GenInterpretation<G>
where G: Send,

§

impl<G> Unpin for GenInterpretation<G>
where G: Unpin,

§

impl<G> UnsafeUnpin for GenInterpretation<G>
where G: UnsafeUnpin,

§

impl<G> UnwindSafe for GenInterpretation<G>
where G: 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<I> AsyncConstGenDomain for I

Source§

async fn async_new_resource( &self, ) -> Result<<I as Domain>::Resource, <I as TryDomain>::Error>

Create a new resource.
Source§

impl<I> AsyncGenDomain for I

Source§

async fn async_new_resource( &mut self, ) -> Result<<I as Domain>::Resource, <I as TryDomain>::Error>

Create a new resource.
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> GenDomain for T
where T: ConstGenDomain,

Source§

fn new_resource(&mut self) -> <T as Domain>::Resource

Create a new resource.
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> TryConstGenDomain for I
where I: ConstGenDomain,

Source§

fn try_new_resource( &self, ) -> Result<<I as Domain>::Resource, <I as TryDomain>::Error>

Tries to create a new resource.
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> TryGenDomain for I

Source§

fn try_new_resource( &mut self, ) -> Result<<I as Domain>::Resource, <I as TryDomain>::Error>

Tries to create a new resource.
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<I> TryInterpretation for I
where I: Interpretation,

Source§

fn try_blank_id( &self, blank_id: &BlankId, ) -> Result<Option<<I as Domain>::Resource>, <I as TryGroundInterpretation>::Error>

Interprets the given blank node identifier, if possible.
Source§

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

Interprets the given term (a blank node identifier or a ground term), if possible.
Source§

fn try_id<'a>( &self, id: impl Into<IdRef<'a>>, ) -> Result<Option<<I as Domain>::Resource>, <I as TryGroundInterpretation>::Error>

Interprets the given identifier (a blank node identifier or an IRI), if possible.
Source§

impl<I> TryInterpretationMut for I

Source§

fn try_insert_blank_id<'a>( &mut self, blank_id: impl Into<Cow<'a, BlankId>>, ) -> Result<<I as Domain>::Resource, <I as TryGroundInterpretation>::Error>

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

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

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

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

Interprets the given identifier, 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.
Source§

impl<I> TryReverseInterpretation for I

Source§

type TryBlankIds<'a> = InfallibleIterator<MapIntoOwned<<I as ReverseInterpretation>::BlankIds<'a>>> where I: 'a

Iterator over the blank node identifiers of a resource.
Source§

fn try_blank_ids_of<'a>( &'a self, resource: &'a <I as Domain>::Resource, ) -> Result<<I as TryReverseInterpretation>::TryBlankIds<'a>, <I as TryGroundInterpretation>::Error>

Returns an iterator over the blank node identifiers of resource.
Source§

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

Returns an iterator over the terms (ground terms and blank node identifiers) of resource.