Skip to main content

TriblePattern

Trait TriblePattern 

Source
pub trait TriblePattern {
    type PatternConstraint<'a>: Constraint<'a>
       where Self: 'a;

    // Required method
    fn pattern<'a, V: ValueSchema>(
        &'a self,
        e: Variable<GenId>,
        a: Variable<GenId>,
        v: Variable<V>,
    ) -> Self::PatternConstraint<'a>;
}
Expand description

Types storing tribles can implement this trait to expose them to queries. The trait provides a method to create a constraint for a given trible pattern.

Required Associated Types§

Source

type PatternConstraint<'a>: Constraint<'a> where Self: 'a

The type of the constraint created by the pattern method.

Required Methods§

Source

fn pattern<'a, V: ValueSchema>( &'a self, e: Variable<GenId>, a: Variable<GenId>, v: Variable<V>, ) -> Self::PatternConstraint<'a>

Create a constraint for a given trible pattern. The method takes three variables, one for each part of the trible. The schemas of the entities and attributes are always GenId, while the value schema can be any type implementing ValueSchema and is specified as a type parameter.

This method is usually not called directly, but rather through typed query language macros like [pattern!][crate::namespace].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl TriblePattern for TribleSet

Source§

type PatternConstraint<'a> = TribleSetConstraint

Source§

impl<U> TriblePattern for SuccinctArchive<U>
where U: Universe,

Source§

type PatternConstraint<'a> = SuccinctArchiveConstraint<'a, U> where U: 'a