Struct ra_ap_ide_completion::CompletionRelevance[][src]

pub struct CompletionRelevance {
    pub exact_name_match: bool,
    pub type_match: Option<CompletionRelevanceTypeMatch>,
    pub is_local: 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
}

Implementations

impl CompletionRelevance[src]

pub fn score(&self) -> u32[src]

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.

pub fn is_relevant(&self) -> bool[src]

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

impl Clone for CompletionRelevance[src]

impl Copy for CompletionRelevance[src]

impl Debug for CompletionRelevance[src]

impl Default for CompletionRelevance[src]

impl Eq for CompletionRelevance[src]

impl PartialEq<CompletionRelevance> for CompletionRelevance[src]

impl StructuralEq for CompletionRelevance[src]

impl StructuralPartialEq for CompletionRelevance[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Cast for T

impl<T> CloneAny for T where
    T: Any + Clone

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.