blob: 87ed5e91ad140b755fe7f3e3b8977b2a9eeae5d7 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Scored set of documents matching a query within a specific segment."><meta name="keywords" content="rust, rustlang, rust-lang, Scorer"><title>Scorer in tantivy::query - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../tantivy/index.html"><div class="logo-container"><img src="http://fulmicoton.com/tantivy-logo/tantivy-logo.png" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../tantivy/index.html"><div class="logo-container">
<img src="http://fulmicoton.com/tantivy-logo/tantivy-logo.png" alt="logo"></div></a><h2 class="location"><a href="#">Scorer</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.score">score</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Scorer-for-Box%3Cdyn%20Scorer%3E">Box&lt;dyn Scorer&gt;</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.downcast">downcast</a></li><li><a href="#method.downcast_mut">downcast_mut</a></li><li><a href="#method.downcast_rc">downcast_rc</a></li><li><a href="#method.downcast_ref">downcast_ref</a></li><li><a href="#method.is">is</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Scorer-for-Box%3Cdyn%20Scorer%3E">Scorer</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In tantivy::query</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">tantivy</a>::<wbr><a href="index.html">query</a>::<wbr><a class="trait" href="#">Scorer</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/tantivy/query/scorer.rs.html#11-16">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait Scorer: <a class="trait" href="../../downcast_rs/trait.Downcast.html" title="trait downcast_rs::Downcast">Downcast</a> + <a class="trait" href="../trait.DocSet.html" title="trait tantivy::DocSet">DocSet</a> + 'static {
fn <a href="#tymethod.score" class="fnname">score</a>(&amp;mut self) -&gt; <a class="type" href="../type.Score.html" title="type tantivy::Score">Score</a>;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Scored set of documents matching a query within a specific segment.</p>
<p>See <a href="trait.Query.html"><code>Query</code></a>.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.score" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#15">source</a><h4 class="code-header">fn <a href="#tymethod.score" class="fnname">score</a>(&amp;mut self) -&gt; <a class="type" href="../type.Score.html" title="type tantivy::Score">Score</a></h4></section></summary><div class="docblock"><p>Returns the score.</p>
<p>This method will perform a bit of computation and is not cached.</p>
</div></details></div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-dyn%20Scorer" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><a href="#impl-dyn%20Scorer" class="anchor"></a><h3 class="code-header">impl dyn <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><h4 class="code-header">pub fn <a href="#method.is" class="fnname">is</a>&lt;__T:&nbsp;<a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the trait object wraps an object of type <code>__T</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.downcast" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><h4 class="code-header">pub fn <a href="#method.downcast" class="fnname">downcast</a>&lt;__T:&nbsp;<a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;(self: Box&lt;Self&gt;) -&gt; Result&lt;Box&lt;__T&gt;, Box&lt;Self&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns a boxed object from a boxed trait object if the underlying object is of type
<code>__T</code>. Returns the original boxed trait if it isn’t.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.downcast_rc" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><h4 class="code-header">pub fn <a href="#method.downcast_rc" class="fnname">downcast_rc</a>&lt;__T:&nbsp;<a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;(self: Rc&lt;Self&gt;) -&gt; Result&lt;Rc&lt;__T&gt;, Rc&lt;Self&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns an <code>Rc</code>-ed object from an <code>Rc</code>-ed trait object if the underlying object is of
type <code>__T</code>. Returns the original <code>Rc</code>-ed trait if it isn’t.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.downcast_ref" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><h4 class="code-header">pub fn <a href="#method.downcast_ref" class="fnname">downcast_ref</a>&lt;__T:&nbsp;<a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;(&amp;self) -&gt; Option&lt;&amp;__T&gt;</h4></section></summary><div class="docblock"><p>Returns a reference to the object within the trait object if it is of type <code>__T</code>, or
<code>None</code> if it isn’t.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.downcast_mut" class="method has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#18">source</a><h4 class="code-header">pub fn <a href="#method.downcast_mut" class="fnname">downcast_mut</a>&lt;__T:&nbsp;<a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;(&amp;mut self) -&gt; Option&lt;&amp;mut __T&gt;</h4></section></summary><div class="docblock"><p>Returns a mutable reference to the object within the trait object if it is of type
<code>__T</code>, or <code>None</code> if it isn’t.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Scorer-for-Box%3Cdyn%20Scorer%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#20-24">source</a><a href="#impl-Scorer-for-Box%3Cdyn%20Scorer%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for Box&lt;dyn <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.score" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#21-23">source</a><a href="#method.score" class="anchor"></a><h4 class="code-header">fn <a href="trait.Scorer.html#tymethod.score" class="fnname">score</a>(&amp;mut self) -&gt; <a class="type" href="../type.Score.html" title="type tantivy::Score">Score</a></h4></section></summary><div class='docblock'>Returns the score. <a href="trait.Scorer.html#tymethod.score">Read more</a></div></details></div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Scorer-for-Box%3Cdyn%20Scorer%3E-1" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#20-24">source</a><a href="#impl-Scorer-for-Box%3Cdyn%20Scorer%3E-1" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for Box&lt;dyn <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>&gt;</h3></section></summary><div class="impl-items"><section id="method.score-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/scorer.rs.html#21-23">source</a><a href="#method.score-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.score" class="fnname">score</a>(&amp;mut self) -&gt; <a class="type" href="../type.Score.html" title="type tantivy::Score">Score</a></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><section id="impl-Scorer-for-AllScorer" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/all_query.rs.html#65-69">source</a><a href="#impl-Scorer-for-AllScorer" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.AllScorer.html" title="struct tantivy::query::AllScorer">AllScorer</a></h3></section><section id="impl-Scorer-for-EmptyScorer" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/empty_query.rs.html#56-60">source</a><a href="#impl-Scorer-for-EmptyScorer" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.EmptyScorer.html" title="struct tantivy::query::EmptyScorer">EmptyScorer</a></h3></section><section id="impl-Scorer-for-ConstScorer%3CTDocSet%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/const_score_query.rs.html#135-139">source</a><a href="#impl-Scorer-for-ConstScorer%3CTDocSet%3E" class="anchor"></a><h3 class="code-header">impl&lt;TDocSet:&nbsp;<a class="trait" href="../trait.DocSet.html" title="trait tantivy::DocSet">DocSet</a> + 'static&gt; <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.ConstScorer.html" title="struct tantivy::query::ConstScorer">ConstScorer</a>&lt;TDocSet&gt;</h3></section><section id="impl-Scorer-for-RequiredOptionalScorer%3CTReqScorer%2C%20TOptScorer%2C%20TScoreCombiner%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/reqopt_scorer.rs.html#68-89">source</a><a href="#impl-Scorer-for-RequiredOptionalScorer%3CTReqScorer%2C%20TOptScorer%2C%20TScoreCombiner%3E" class="anchor"></a><h3 class="code-header">impl&lt;TReqScorer, TOptScorer, TScoreCombiner&gt; <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.RequiredOptionalScorer.html" title="struct tantivy::query::RequiredOptionalScorer">RequiredOptionalScorer</a>&lt;TReqScorer, TOptScorer, TScoreCombiner&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;TReqScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;TOptScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;TScoreCombiner: <a class="trait" href="trait.ScoreCombiner.html" title="trait tantivy::query::ScoreCombiner">ScoreCombiner</a>,</span></h3></section><section id="impl-Scorer-for-Exclude%3CTScorer%2C%20TDocSetExclude%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/exclude.rs.html#82-90">source</a><a href="#impl-Scorer-for-Exclude%3CTScorer%2C%20TDocSetExclude%3E" class="anchor"></a><h3 class="code-header">impl&lt;TScorer, TDocSetExclude&gt; <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.Exclude.html" title="struct tantivy::query::Exclude">Exclude</a>&lt;TScorer, TDocSetExclude&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;TScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;TDocSetExclude: <a class="trait" href="../trait.DocSet.html" title="trait tantivy::DocSet">DocSet</a> + 'static,</span></h3></section><section id="impl-Scorer-for-Intersection%3CTScorer%2C%20TOtherScorer%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/intersection.rs.html#148-158">source</a><a href="#impl-Scorer-for-Intersection%3CTScorer%2C%20TOtherScorer%3E" class="anchor"></a><h3 class="code-header">impl&lt;TScorer, TOtherScorer&gt; <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.Intersection.html" title="struct tantivy::query::Intersection">Intersection</a>&lt;TScorer, TOtherScorer&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;TScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;TOtherScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,</span></h3></section><section id="impl-Scorer-for-Union%3CTScorer%2C%20TScoreCombiner%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tantivy/query/union.rs.html#233-241">source</a><a href="#impl-Scorer-for-Union%3CTScorer%2C%20TScoreCombiner%3E" class="anchor"></a><h3 class="code-header">impl&lt;TScorer, TScoreCombiner&gt; <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a> for <a class="struct" href="struct.Union.html" title="struct tantivy::query::Union">Union</a>&lt;TScorer, TScoreCombiner&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;TScoreCombiner: <a class="trait" href="trait.ScoreCombiner.html" title="trait tantivy::query::ScoreCombiner">ScoreCombiner</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;TScorer: <a class="trait" href="trait.Scorer.html" title="trait tantivy::query::Scorer">Scorer</a>,</span></h3></section></div><script src="../../implementors/tantivy/query/scorer/trait.Scorer.js" data-ignore-extern-crates="alloc" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tantivy" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>