pub struct MethodSpecificity { /* private fields */ }Expand description
How specifically a method matched a particular call.
Carries the per-argument MatchScores plus their total; comparing two
specificities (see compare_specificity) orders methods most-specific
first for applicable-method selection.
Implementations§
Source§impl MethodSpecificity
impl MethodSpecificity
Sourcepub fn new(
method: Symbol,
role: MethodRole,
score: MatchScore,
argument_scores: Vec<MatchScore>,
) -> Self
pub fn new( method: Symbol, role: MethodRole, score: MatchScore, argument_scores: Vec<MatchScore>, ) -> Self
Builds a specificity record for a matched method.
Sourcepub fn role(&self) -> MethodRole
pub fn role(&self) -> MethodRole
Returns the matched method’s role in the combination.
Sourcepub fn score(&self) -> MatchScore
pub fn score(&self) -> MatchScore
Returns the total match score across all arguments.
Sourcepub fn argument_scores(&self) -> &[MatchScore]
pub fn argument_scores(&self) -> &[MatchScore]
Returns the per-argument match scores, in argument order.
Trait Implementations§
Source§impl Clone for MethodSpecificity
impl Clone for MethodSpecificity
Source§fn clone(&self) -> MethodSpecificity
fn clone(&self) -> MethodSpecificity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MethodSpecificity
impl Debug for MethodSpecificity
impl Eq for MethodSpecificity
Source§impl PartialEq for MethodSpecificity
impl PartialEq for MethodSpecificity
Source§fn eq(&self, other: &MethodSpecificity) -> bool
fn eq(&self, other: &MethodSpecificity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MethodSpecificity
Auto Trait Implementations§
impl Freeze for MethodSpecificity
impl RefUnwindSafe for MethodSpecificity
impl Send for MethodSpecificity
impl Sync for MethodSpecificity
impl Unpin for MethodSpecificity
impl UnsafeUnpin for MethodSpecificity
impl UnwindSafe for MethodSpecificity
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