pub struct Rule {
pub name: String,
pub overloads: Vec<RuleOverload>,
}
Expand description
A function.
Fields§
§name: String
Rule’s name
overloads: Vec<RuleOverload>
Rule’s overloads.
Implementations§
source§impl Rule
impl Rule
sourcepub fn match_params(expected: (&Type, &Type), received: (&Type, &Type)) -> bool
pub fn match_params(expected: (&Type, &Type), received: (&Type, &Type)) -> bool
Checks if the given params can be converted into the expected params.
§Panics
Never. Shut up, clippy.
sourcepub fn get_overload(&self, received: (&Type, &Type)) -> Option<&RuleOverload>
pub fn get_overload(&self, received: (&Type, &Type)) -> Option<&RuleOverload>
Tries to find an overload for the given param types.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl !RefUnwindSafe for Rule
impl !Send for Rule
impl !Sync for Rule
impl Unpin for Rule
impl !UnwindSafe for Rule
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> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more