Struct ra_ap_ide::CompletionRelevance [−][src]
pub struct CompletionRelevance { pub exact_name_match: bool, pub type_match: Option<CompletionRelevanceTypeMatch>, pub is_local: bool, pub exact_postfix_snippet_match: bool, }
Fields
exact_name_match: bool
This is set in cases like these:
fn f(spam: String) {} fn main { let spam = 92; f($0) // name of local matches the name of param }
type_match: Option<CompletionRelevanceTypeMatch>
See CompletionRelevanceTypeMatch doc comments for cases where this is set.
is_local: bool
This is set in cases like these:
fn foo(a: u32) { let b = 0; $0 // `a` and `b` are local }
exact_postfix_snippet_match: bool
This is set in cases like these:
(a > b).not$0
Basically, we want to guarantee that postfix snippets always takes precedence over everything else.
Implementations
Provides a relevance score. Higher values are more relevant.
The absolute value of the relevance score is not meaningful, for example a value of 0 doesn’t mean “not relevant”, rather it means “least relevant”. The score value should only be used for relative ordering.
See is_relevant if you need to make some judgement about score in an absolute sense.
Returns true when the score for this threshold is above some threshold such that we think it is especially likely to be relevant.
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CompletionRelevance
impl Send for CompletionRelevance
impl Sync for CompletionRelevance
impl Unpin for CompletionRelevance
impl UnwindSafe for CompletionRelevance
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<T> Any for T where
T: Any,