pub struct PredicatePattern {
pub name_pattern: Option<String>,
pub min_arity: Option<usize>,
pub max_arity: Option<usize>,
pub required_domains: Vec<String>,
pub excluded_domains: Vec<String>,
}Expand description
Pattern for predicate matching
Fields§
§name_pattern: Option<String>Name pattern (supports wildcards)
min_arity: Option<usize>Minimum arity
max_arity: Option<usize>Maximum arity
required_domains: Vec<String>Required domains (at any position)
excluded_domains: Vec<String>Excluded domains
Implementations§
Source§impl PredicatePattern
impl PredicatePattern
pub fn new() -> Self
pub fn with_name_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_arity_range(self, min: usize, max: usize) -> Self
pub fn with_required_domain(self, domain: impl Into<String>) -> Self
pub fn with_excluded_domain(self, domain: impl Into<String>) -> Self
Sourcepub fn matches(&self, name: &str, predicate: &PredicateInfo) -> bool
pub fn matches(&self, name: &str, predicate: &PredicateInfo) -> bool
Check if a predicate matches this pattern
Trait Implementations§
Source§impl Clone for PredicatePattern
impl Clone for PredicatePattern
Source§fn clone(&self) -> PredicatePattern
fn clone(&self) -> PredicatePattern
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 PredicatePattern
impl Debug for PredicatePattern
Source§impl Default for PredicatePattern
impl Default for PredicatePattern
Source§impl Hash for PredicatePattern
impl Hash for PredicatePattern
Source§impl PartialEq for PredicatePattern
impl PartialEq for PredicatePattern
impl Eq for PredicatePattern
impl StructuralPartialEq for PredicatePattern
Auto Trait Implementations§
impl Freeze for PredicatePattern
impl RefUnwindSafe for PredicatePattern
impl Send for PredicatePattern
impl Sync for PredicatePattern
impl Unpin for PredicatePattern
impl UnwindSafe for PredicatePattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.