pub struct CompositePredicate {
pub name: String,
pub parameters: Vec<String>,
pub body: PredicateBody,
pub description: Option<String>,
}Expand description
A composable predicate definition that can be expanded.
Composite predicates are defined in terms of other predicates and can include parameters that are substituted during expansion.
Fields§
§name: StringName of this composite predicate
parameters: Vec<String>Parameter names (e.g., [“x”, “y”])
body: PredicateBodyThe body expression defining this predicate
description: Option<String>Optional description
Implementations§
Source§impl CompositePredicate
impl CompositePredicate
Sourcepub fn new(
name: impl Into<String>,
parameters: Vec<String>,
body: PredicateBody,
) -> Self
pub fn new( name: impl Into<String>, parameters: Vec<String>, body: PredicateBody, ) -> Self
Creates a new composite predicate.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Sets the description for this composite predicate.
Sourcepub fn validate(&self) -> Result<(), AdapterError>
pub fn validate(&self) -> Result<(), AdapterError>
Validates that this composite predicate is well-formed.
Sourcepub fn expand(&self, args: &[String]) -> Result<PredicateBody, AdapterError>
pub fn expand(&self, args: &[String]) -> Result<PredicateBody, AdapterError>
Expands this composite predicate with the given arguments.
Substitutes all parameter occurrences in the body with the provided arguments.
Trait Implementations§
Source§impl Clone for CompositePredicate
impl Clone for CompositePredicate
Source§fn clone(&self) -> CompositePredicate
fn clone(&self) -> CompositePredicate
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 CompositePredicate
impl Debug for CompositePredicate
Source§impl<'de> Deserialize<'de> for CompositePredicate
impl<'de> Deserialize<'de> for CompositePredicate
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 CompositePredicate
impl RefUnwindSafe for CompositePredicate
impl Send for CompositePredicate
impl Sync for CompositePredicate
impl Unpin for CompositePredicate
impl UnwindSafe for CompositePredicate
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