Struct imdb_index::SearchResults [] [src]

pub struct SearchResults<T>(_);

A collection of scored values, sorted in descending order by score.

Methods

impl<T> SearchResults<T>
[src]

[src]

Create an empty collection of scored values.

[src]

Create a collection of search results from a min-heap of scored values.

[src]

Add a new scored value to this collection.

The score provided must be less than or equal to every other score in this collection, otherwise this method will panic.

[src]

Normalizes the scores in this collection such that all scores are in the range [0, 1] where the top result always has score 1.0.

This operation is idempotent and does not change the ordering of results.

[src]

Recomputes the scores in this collection using the given function.

The results are then re-sorted according to the new scores.

[src]

Trim this collection so that it contains at most the first size results.

[src]

Returns the number of results in this collection.

[src]

Returns true if and only if this collection is empty.

[src]

Return a slice of search results in order.

[src]

Consume this collection and return the underlying sorted sequence of scored values.

Trait Implementations

impl<T: Clone> Clone for SearchResults<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for SearchResults<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Default> Default for SearchResults<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T> IntoIterator for SearchResults<T>
[src]

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

[src]

Creates an iterator from a value. Read more

Auto Trait Implementations

impl<T> Send for SearchResults<T> where
    T: Send

impl<T> Sync for SearchResults<T> where
    T: Sync