pub struct PredicateTemplate {
pub name: String,
pub type_params: Vec<String>,
pub value_params: Vec<String>,
pub body: PredicateBody,
}Expand description
A template for creating multiple similar predicates.
Templates allow defining patterns for predicates that can be instantiated with different domains or properties.
Fields§
§name: StringTemplate name
type_params: Vec<String>Type parameters (e.g., [“T”, “U”])
value_params: Vec<String>Value parameters (e.g., [“relation”])
body: PredicateBodyThe body defining how to construct the predicate
Implementations§
Source§impl PredicateTemplate
impl PredicateTemplate
Sourcepub fn new(
name: impl Into<String>,
type_params: Vec<String>,
value_params: Vec<String>,
body: PredicateBody,
) -> Self
pub fn new( name: impl Into<String>, type_params: Vec<String>, value_params: Vec<String>, body: PredicateBody, ) -> Self
Creates a new predicate template.
Sourcepub fn instantiate(
&self,
type_args: &[String],
value_args: &[String],
) -> Result<CompositePredicate, AdapterError>
pub fn instantiate( &self, type_args: &[String], value_args: &[String], ) -> Result<CompositePredicate, AdapterError>
Instantiates this template with concrete types and values.
Trait Implementations§
Source§impl Clone for PredicateTemplate
impl Clone for PredicateTemplate
Source§fn clone(&self) -> PredicateTemplate
fn clone(&self) -> PredicateTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PredicateTemplate
impl Debug for PredicateTemplate
Source§impl<'de> Deserialize<'de> for PredicateTemplate
impl<'de> Deserialize<'de> for PredicateTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PredicateTemplate
impl RefUnwindSafe for PredicateTemplate
impl Send for PredicateTemplate
impl Sync for PredicateTemplate
impl Unpin for PredicateTemplate
impl UnwindSafe for PredicateTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more