pub trait TriblePattern {
type PatternConstraint<'a>: Constraint<'a> + Send + Sync
where Self: 'a;
// Required method
fn pattern<'a, V: InlineEncoding>(
&'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§
Sourcetype PatternConstraint<'a>: Constraint<'a> + Send + Sync
where
Self: 'a
type PatternConstraint<'a>: Constraint<'a> + Send + Sync where Self: 'a
The type of the constraint created by the pattern method.
Send + Sync is required so the resulting constraint tree can be
used with the parallel feature’s rayon iterators. Every in-tree
pattern backend (TribleSet, SuccinctArchive) satisfies this; custom
implementations should hold their data behind Arc or similar.
Required Methods§
Sourcefn pattern<'a, V: InlineEncoding>(
&'a self,
e: Variable<GenId>,
a: Variable<GenId>,
v: Variable<V>,
) -> Self::PatternConstraint<'a>
fn pattern<'a, V: InlineEncoding>( &'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 InlineEncoding and is specified as a type parameter.
This method is usually not called directly, but rather through typed query language macros like pattern!.
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.