pub struct PredicateSignature {
pub name: String,
pub arg_types: Vec<TypeAnnotation>,
pub arity: usize,
}Expand description
Signature for a predicate: defines expected argument types
Fields§
§name: String§arg_types: Vec<TypeAnnotation>§arity: usizeImplementations§
Source§impl PredicateSignature
impl PredicateSignature
pub fn new(name: impl Into<String>, arg_types: Vec<TypeAnnotation>) -> Self
Sourcepub fn untyped(name: impl Into<String>, arity: usize) -> Self
pub fn untyped(name: impl Into<String>, arity: usize) -> Self
Create an untyped signature (for backward compatibility)
Sourcepub fn matches_arity(&self, arg_count: usize) -> bool
pub fn matches_arity(&self, arg_count: usize) -> bool
Check if this signature matches the given number of arguments
Sourcepub fn matches_types(&self, arg_types: &[Option<&TypeAnnotation>]) -> bool
pub fn matches_types(&self, arg_types: &[Option<&TypeAnnotation>]) -> bool
Check if the given argument types match this signature
Trait Implementations§
Source§impl Clone for PredicateSignature
impl Clone for PredicateSignature
Source§fn clone(&self) -> PredicateSignature
fn clone(&self) -> PredicateSignature
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 PredicateSignature
impl Debug for PredicateSignature
Source§impl<'de> Deserialize<'de> for PredicateSignature
impl<'de> Deserialize<'de> for PredicateSignature
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
Source§impl PartialEq for PredicateSignature
impl PartialEq for PredicateSignature
Source§impl Serialize for PredicateSignature
impl Serialize for PredicateSignature
impl Eq for PredicateSignature
impl StructuralPartialEq for PredicateSignature
Auto Trait Implementations§
impl Freeze for PredicateSignature
impl RefUnwindSafe for PredicateSignature
impl Send for PredicateSignature
impl Sync for PredicateSignature
impl Unpin for PredicateSignature
impl UnwindSafe for PredicateSignature
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