mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-12 09:19:44 +00:00
Deploying to gh-pages from @ GreptimeTeam/greptimedb@bb15690aa6 🚀
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<!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="According to the `opts`, choose peers from the `weight_array` through `weighted_choose`."><title>choose_items in meta_srv::selector::common - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">choose_items</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector::<wbr>common</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a>::<wbr><a href="index.html">common</a></div><h1>Function <span class="fn">choose_<wbr>items</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/common.rs.html#35-85">Source</a> </span></div><pre class="rust item-decl"><code>pub fn choose_items<W>(
|
||||
opts: &<a class="struct" href="../struct.SelectorOptions.html" title="struct meta_srv::selector::SelectorOptions">SelectorOptions</a>,
|
||||
weighted_choose: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut W</a>,
|
||||
) -> <a class="type" href="../../error/type.Result.html" title="type meta_srv::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Peer>><div class="where">where
|
||||
W: <a class="trait" href="../weighted_choose/trait.WeightedChoose.html" title="trait meta_srv::selector::weighted_choose::WeightedChoose">WeightedChoose</a><Peer>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>According to the <code>opts</code>, choose peers from the <code>weight_array</code> through <code>weighted_choose</code>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<!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="Filter out the excluded peers from the `weight_array`."><title>filter_out_excluded_peers in meta_srv::selector::common - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">filter_out_excluded_peers</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector::<wbr>common</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a>::<wbr><a href="index.html">common</a></div><h1>Function <span class="fn">filter_<wbr>out_<wbr>excluded_<wbr>peers</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/common.rs.html#27-32">Source</a> </span></div><pre class="rust item-decl"><code>pub fn filter_out_excluded_peers(
|
||||
weight_array: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../weighted_choose/struct.WeightedItem.html" title="struct meta_srv::selector::weighted_choose::WeightedItem">WeightedItem</a><Peer>>,
|
||||
exclude_peer_ids: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>>,
|
||||
)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Filter out the excluded peers from the <code>weight_array</code>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!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="API documentation for the Rust `common` mod in crate `meta_srv`."><title>meta_srv::selector::common - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module common</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module common</a></h2><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>common</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/common.rs.html#15-208">Source</a> </span></div><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.choose_items.html" title="fn meta_srv::selector::common::choose_items">choose_<wbr>items</a></dt><dd>According to the <code>opts</code>, choose peers from the <code>weight_array</code> through <code>weighted_choose</code>.</dd><dt><a class="fn" href="fn.filter_out_excluded_peers.html" title="fn meta_srv::selector::common::filter_out_excluded_peers">filter_<wbr>out_<wbr>excluded_<wbr>peers</a></dt><dd>Filter out the excluded peers from the <code>weight_array</code>.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["choose_items","filter_out_excluded_peers"]};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<!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="API documentation for the Rust `lease_based` mod in crate `meta_srv`."><title>meta_srv::selector::lease_based - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module lease_based</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module lease_<wbr>based</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>lease_<wbr>based</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/lease_based.rs.html#15-60">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.LeaseBasedSelector.html" title="struct meta_srv::selector::lease_based::LeaseBasedSelector">Lease<wbr>Based<wbr>Selector</a></dt><dd>Select all alive datanodes based using a random weighted choose.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["LeaseBasedSelector"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
<!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="API documentation for the Rust `filter_out_expired_datanode` fn in crate `meta_srv`."><title>filter_out_expired_datanode in meta_srv::selector::load_based - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">filter_out_expired_datanode</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector::<wbr>load_<wbr>based</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a>::<wbr><a href="index.html">load_based</a></div><h1>Function <span class="fn">filter_<wbr>out_<wbr>expired_<wbr>datanode</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/load_based.rs.html#91-99">Source</a> </span></div><pre class="rust item-decl"><code>fn filter_out_expired_datanode(
|
||||
stat_kvs: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DatanodeStatKey, DatanodeStatValue>,
|
||||
datanodes: &[Peer],
|
||||
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DatanodeStatKey, DatanodeStatValue></code></pre></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!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="API documentation for the Rust `load_based` mod in crate `meta_srv`."><title>meta_srv::selector::load_based - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module load_based</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module load_<wbr>based</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>load_<wbr>based</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/load_based.rs.html#15-132">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.LoadBasedSelector.html" title="struct meta_srv::selector::load_based::LoadBasedSelector">Load<wbr>Based<wbr>Selector</a></dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.filter_out_expired_datanode.html" title="fn meta_srv::selector::load_based::filter_out_expired_datanode">filter_<wbr>out_<wbr>expired_<wbr>datanode</a><span title="Restricted Visibility"> 🔒</span> </dt></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["filter_out_expired_datanode"],"struct":["LoadBasedSelector"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
<!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="API documentation for the Rust `round_robin` mod in crate `meta_srv`."><title>meta_srv::selector::round_robin - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module round_robin</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module round_<wbr>robin</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>round_<wbr>robin</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/round_robin.rs.html#15-227">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.RoundRobinSelector.html" title="struct meta_srv::selector::round_robin::RoundRobinSelector">Round<wbr>Robin<wbr>Selector</a></dt><dd>Round-robin selector that returns the next peer in the list in sequence.
|
||||
Datanodes are ordered by their node_id.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["RoundRobinSelector"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["SelectorType"],"mod":["common","lease_based","load_based","round_robin","weight_compute","weighted_choose"],"struct":["SelectorOptions"],"trait":["RegionStatAwareSelector","Selector"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
<!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="A selector that aware of region statistics"><title>RegionStatAwareSelector in meta_srv::selector - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">RegionStatAwareSelector</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Region<wbr>Stat<wbr>Aware<wbr>Selector</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Context" title="Context">Context</a></li><li><a href="#associatedtype.Output" title="Output">Output</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.select" title="select">select</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">meta_srv</a>::<wbr><a href="index.html">selector</a></div><h1>Trait <span class="trait">Region<wbr>Stat<wbr>Aware<wbr>Selector</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/meta_srv/selector.rs.html#46-57">Source</a> </span></div><pre class="rust item-decl"><code>pub trait RegionStatAwareSelector: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
|
||||
type <a href="#associatedtype.Context" class="associatedtype">Context</a>;
|
||||
type <a href="#associatedtype.Output" class="associatedtype">Output</a>;
|
||||
|
||||
// Required method
|
||||
fn <a href="#tymethod.select" class="fn">select</a><'life0, 'life1, 'life2, 'async_trait>(
|
||||
&'life0 self,
|
||||
ctx: &'life1 Self::<a class="associatedtype" href="trait.RegionStatAwareSelector.html#associatedtype.Context" title="type meta_srv::selector::RegionStatAwareSelector::Context">Context</a>,
|
||||
from_peer_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||||
region_ids: &'life2 [RegionId],
|
||||
exclude_peer_ids: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>>,
|
||||
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Self::<a class="associatedtype" href="trait.RegionStatAwareSelector.html#associatedtype.Output" title="type meta_srv::selector::RegionStatAwareSelector::Output">Output</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>>
|
||||
<span class="where">where Self: 'async_trait,
|
||||
'life0: 'async_trait,
|
||||
'life1: 'async_trait,
|
||||
'life2: 'async_trait</span>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A selector that aware of region statistics</p>
|
||||
<p>It selects the best destination peer for a list of regions.
|
||||
The selection is based on the region statistics, such as the region leader’s write throughput.</p>
|
||||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.Context" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#47">Source</a><h4 class="code-header">type <a href="#associatedtype.Context" class="associatedtype">Context</a></h4></section><section id="associatedtype.Output" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#48">Source</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.select" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#50-56">Source</a><h4 class="code-header">fn <a href="#tymethod.select" class="fn">select</a><'life0, 'life1, 'life2, 'async_trait>(
|
||||
&'life0 self,
|
||||
ctx: &'life1 Self::<a class="associatedtype" href="trait.RegionStatAwareSelector.html#associatedtype.Context" title="type meta_srv::selector::RegionStatAwareSelector::Context">Context</a>,
|
||||
from_peer_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||||
region_ids: &'life2 [RegionId],
|
||||
exclude_peer_ids: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>>,
|
||||
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Self::<a class="associatedtype" href="trait.RegionStatAwareSelector.html#associatedtype.Output" title="type meta_srv::selector::RegionStatAwareSelector::Output">Output</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
||||
Self: 'async_trait,
|
||||
'life0: 'async_trait,
|
||||
'life1: 'async_trait,
|
||||
'life2: 'async_trait,</div></h4></section></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/meta_srv/selector/trait.RegionStatAwareSelector.js" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!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="API documentation for the Rust `Selector` trait in crate `meta_srv`."><title>Selector in meta_srv::selector - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Selector</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Selector</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Context" title="Context">Context</a></li><li><a href="#associatedtype.Output" title="Output">Output</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.select" title="select">select</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">meta_srv</a>::<wbr><a href="index.html">selector</a></div><h1>Trait <span class="trait">Selector</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/meta_srv/selector.rs.html#34-39">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Selector: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
|
||||
type <a href="#associatedtype.Context" class="associatedtype">Context</a>;
|
||||
type <a href="#associatedtype.Output" class="associatedtype">Output</a>;
|
||||
|
||||
// Required method
|
||||
fn <a href="#tymethod.select" class="fn">select</a><'life0, 'life1, 'async_trait>(
|
||||
&'life0 self,
|
||||
ctx: &'life1 Self::<a class="associatedtype" href="trait.Selector.html#associatedtype.Context" title="type meta_srv::selector::Selector::Context">Context</a>,
|
||||
opts: <a class="struct" href="struct.SelectorOptions.html" title="struct meta_srv::selector::SelectorOptions">SelectorOptions</a>,
|
||||
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Self::<a class="associatedtype" href="trait.Selector.html#associatedtype.Output" title="type meta_srv::selector::Selector::Output">Output</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>>
|
||||
<span class="where">where Self: 'async_trait,
|
||||
'life0: 'async_trait,
|
||||
'life1: 'async_trait</span>;
|
||||
}</code></pre><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.Context" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#35">Source</a><h4 class="code-header">type <a href="#associatedtype.Context" class="associatedtype">Context</a></h4></section><section id="associatedtype.Output" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#36">Source</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.select" class="method"><a class="src rightside" href="../../src/meta_srv/selector.rs.html#38">Source</a><h4 class="code-header">fn <a href="#tymethod.select" class="fn">select</a><'life0, 'life1, 'async_trait>(
|
||||
&'life0 self,
|
||||
ctx: &'life1 Self::<a class="associatedtype" href="trait.Selector.html#associatedtype.Context" title="type meta_srv::selector::Selector::Context">Context</a>,
|
||||
opts: <a class="struct" href="struct.SelectorOptions.html" title="struct meta_srv::selector::SelectorOptions">SelectorOptions</a>,
|
||||
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Self::<a class="associatedtype" href="trait.Selector.html#associatedtype.Output" title="type meta_srv::selector::Selector::Output">Output</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
||||
Self: 'async_trait,
|
||||
'life0: 'async_trait,
|
||||
'life1: 'async_trait,</div></h4></section></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><details class="toggle implementors-toggle"><summary><section id="impl-Selector-for-LeaseBasedSelector" class="impl"><a class="src rightside" href="../../src/meta_srv/selector/lease_based.rs.html#29-60">Source</a><a href="#impl-Selector-for-LeaseBasedSelector" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Selector.html" title="trait meta_srv::selector::Selector">Selector</a> for <a class="struct" href="lease_based/struct.LeaseBasedSelector.html" title="struct meta_srv::selector::lease_based::LeaseBasedSelector">LeaseBasedSelector</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Context-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/lease_based.rs.html#30">Source</a><a href="#associatedtype.Context-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Context" class="associatedtype">Context</a> = <a class="struct" href="../metasrv/struct.SelectorContext.html" title="struct meta_srv::metasrv::SelectorContext">SelectorContext</a></h4></section><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/lease_based.rs.html#31">Source</a><a href="#associatedtype.Output-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Peer></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Selector-for-RoundRobinSelector" class="impl"><a class="src rightside" href="../../src/meta_srv/selector/round_robin.rs.html#99-117">Source</a><a href="#impl-Selector-for-RoundRobinSelector" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Selector.html" title="trait meta_srv::selector::Selector">Selector</a> for <a class="struct" href="round_robin/struct.RoundRobinSelector.html" title="struct meta_srv::selector::round_robin::RoundRobinSelector">RoundRobinSelector</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Context-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/round_robin.rs.html#100">Source</a><a href="#associatedtype.Context-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Context" class="associatedtype">Context</a> = <a class="struct" href="../metasrv/struct.SelectorContext.html" title="struct meta_srv::metasrv::SelectorContext">SelectorContext</a></h4></section><section id="associatedtype.Output-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/round_robin.rs.html#101">Source</a><a href="#associatedtype.Output-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Peer></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Selector-for-LoadBasedSelector%3CC%3E" class="impl"><a class="src rightside" href="../../src/meta_srv/selector/load_based.rs.html#45-89">Source</a><a href="#impl-Selector-for-LoadBasedSelector%3CC%3E" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.Selector.html" title="trait meta_srv::selector::Selector">Selector</a> for <a class="struct" href="load_based/struct.LoadBasedSelector.html" title="struct meta_srv::selector::load_based::LoadBasedSelector">LoadBasedSelector</a><C><div class="where">where
|
||||
C: <a class="trait" href="weight_compute/trait.WeightCompute.html" title="trait meta_srv::selector::weight_compute::WeightCompute">WeightCompute</a><Source = <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DatanodeStatKey, DatanodeStatValue>>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Context-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/load_based.rs.html#49">Source</a><a href="#associatedtype.Context-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Context" class="associatedtype">Context</a> = <a class="struct" href="../metasrv/struct.SelectorContext.html" title="struct meta_srv::metasrv::SelectorContext">SelectorContext</a></h4></section><section id="associatedtype.Output-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/meta_srv/selector/load_based.rs.html#50">Source</a><a href="#associatedtype.Output-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Peer></h4></section></div></details></div><script src="../../trait.impl/meta_srv/selector/trait.Selector.js" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!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="API documentation for the Rust `weight_compute` mod in crate `meta_srv`."><title>meta_srv::selector::weight_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module weight_compute</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module weight_<wbr>compute</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>weight_<wbr>compute</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/weight_compute.rs.html#15-267">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.RegionNumsBasedWeightCompute.html" title="struct meta_srv::selector::weight_compute::RegionNumsBasedWeightCompute">Region<wbr>Nums<wbr>Based<wbr>Weight<wbr>Compute</a></dt><dd>The [‘RegionNumsBasedWeightCompute’] calculates weighted list based on region number obtained from the heartbeat.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.WeightCompute.html" title="trait meta_srv::selector::weight_compute::WeightCompute">Weight<wbr>Compute</a></dt><dd>The <a href="trait.WeightCompute.html" title="trait meta_srv::selector::weight_compute::WeightCompute"><code>WeightCompute</code></a> trait is used to compute the weight array by heartbeats.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["RegionNumsBasedWeightCompute"],"trait":["WeightCompute"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
<!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="The `WeightCompute` trait is used to compute the weight array by heartbeats."><title>WeightCompute in meta_srv::selector::weight_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">WeightCompute</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Weight<wbr>Compute</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Source" title="Source">Source</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.compute" title="compute">compute</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector::<wbr>weight_<wbr>compute</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a>::<wbr><a href="index.html">weight_compute</a></div><h1>Trait <span class="trait">Weight<wbr>Compute</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/weight_compute.rs.html#24-28">Source</a> </span></div><pre class="rust item-decl"><code>pub trait WeightCompute: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
|
||||
type <a href="#associatedtype.Source" class="associatedtype">Source</a>;
|
||||
|
||||
// Required method
|
||||
fn <a href="#tymethod.compute" class="fn">compute</a>(&self, stat_kvs: &Self::<a class="associatedtype" href="trait.WeightCompute.html#associatedtype.Source" title="type meta_srv::selector::weight_compute::WeightCompute::Source">Source</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../weighted_choose/struct.WeightedItem.html" title="struct meta_srv::selector::weighted_choose::WeightedItem">WeightedItem</a><Peer>>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <a href="trait.WeightCompute.html" title="trait meta_srv::selector::weight_compute::WeightCompute"><code>WeightCompute</code></a> trait is used to compute the weight array by heartbeats.</p>
|
||||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.Source" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weight_compute.rs.html#25">Source</a><h4 class="code-header">type <a href="#associatedtype.Source" class="associatedtype">Source</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.compute" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weight_compute.rs.html#27">Source</a><h4 class="code-header">fn <a href="#tymethod.compute" class="fn">compute</a>(&self, stat_kvs: &Self::<a class="associatedtype" href="trait.WeightCompute.html#associatedtype.Source" title="type meta_srv::selector::weight_compute::WeightCompute::Source">Source</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../weighted_choose/struct.WeightedItem.html" title="struct meta_srv::selector::weighted_choose::WeightedItem">WeightedItem</a><Peer>></h4></section></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><details class="toggle implementors-toggle"><summary><section id="impl-WeightCompute-for-RegionNumsBasedWeightCompute" class="impl"><a class="src rightside" href="../../../src/meta_srv/selector/weight_compute.rs.html#39-91">Source</a><a href="#impl-WeightCompute-for-RegionNumsBasedWeightCompute" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.WeightCompute.html" title="trait meta_srv::selector::weight_compute::WeightCompute">WeightCompute</a> for <a class="struct" href="struct.RegionNumsBasedWeightCompute.html" title="struct meta_srv::selector::weight_compute::RegionNumsBasedWeightCompute">RegionNumsBasedWeightCompute</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Source-1" class="associatedtype trait-impl"><a class="src rightside" href="../../../src/meta_srv/selector/weight_compute.rs.html#40">Source</a><a href="#associatedtype.Source-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Source" class="associatedtype">Source</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DatanodeStatKey, DatanodeStatValue></h4></section></div></details></div><script src="../../../trait.impl/meta_srv/selector/weight_compute/trait.WeightCompute.js" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!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="API documentation for the Rust `weighted_choose` mod in crate `meta_srv`."><title>meta_srv::selector::weighted_choose - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module weighted_choose</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module weighted_<wbr>choose</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In meta_<wbr>srv::<wbr>selector</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a></div><h1>Module <span>weighted_<wbr>choose</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/weighted_choose.rs.html#15-141">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.RandomWeightedChoose.html" title="struct meta_srv::selector::weighted_choose::RandomWeightedChoose">Random<wbr>Weighted<wbr>Choose</a></dt><dd>A implementation of weighted balance: random weighted choose.</dd><dt><a class="struct" href="struct.WeightedItem.html" title="struct meta_srv::selector::weighted_choose::WeightedItem">Weighted<wbr>Item</a></dt><dd>The struct represents a weighted item.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.WeightedChoose.html" title="trait meta_srv::selector::weighted_choose::WeightedChoose">Weighted<wbr>Choose</a></dt><dd>A common trait for weighted balance algorithm.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["RandomWeightedChoose","WeightedItem"],"trait":["WeightedChoose"]};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
||||
<!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="A common trait for weighted balance algorithm."><title>WeightedChoose in meta_srv::selector::weighted_choose - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="meta_srv" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">WeightedChoose</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../meta_srv/index.html">meta_<wbr>srv</a><span class="version">1.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Weighted<wbr>Choose</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.choose_multiple" title="choose_multiple">choose_multiple</a></li><li><a href="#tymethod.choose_one" title="choose_one">choose_one</a></li><li><a href="#tymethod.len" title="len">len</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.is_empty" title="is_empty">is_empty</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In meta_<wbr>srv::<wbr>selector::<wbr>weighted_<wbr>choose</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">meta_srv</a>::<wbr><a href="../index.html">selector</a>::<wbr><a href="index.html">weighted_choose</a></div><h1>Trait <span class="trait">Weighted<wbr>Choose</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/meta_srv/selector/weighted_choose.rs.html#23-42">Source</a> </span></div><pre class="rust item-decl"><code>pub trait WeightedChoose<Item>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.choose_one" class="fn">choose_one</a>(&mut self) -> <a class="type" href="../../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Item>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.choose_multiple" class="fn">choose_multiple</a>(&mut self, amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="../../error/type.Result.html" title="type meta_srv::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Item>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
|
||||
|
||||
// Provided method
|
||||
fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A common trait for weighted balance algorithm.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.choose_one" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weighted_choose.rs.html#25">Source</a><h4 class="code-header">fn <a href="#tymethod.choose_one" class="fn">choose_one</a>(&mut self) -> <a class="type" href="../../error/type.Result.html" title="type meta_srv::error::Result">Result</a><Item></h4></section></summary><div class="docblock"><p>The method will choose one item.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.choose_multiple" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weighted_choose.rs.html#33">Source</a><h4 class="code-header">fn <a href="#tymethod.choose_multiple" class="fn">choose_multiple</a>(&mut self, amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="../../error/type.Result.html" title="type meta_srv::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Item>></h4></section></summary><div class="docblock"><p>The method will choose multiple items.</p>
|
||||
<h6 id="note"><a class="doc-anchor" href="#note">§</a>Note</h6>
|
||||
<ul>
|
||||
<li>Returns less than <code>amount</code> items if the weight_array is not enough.</li>
|
||||
<li>The returned items cannot be duplicated.</li>
|
||||
</ul>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.len" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weighted_choose.rs.html#36">Source</a><h4 class="code-header">fn <a href="#tymethod.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the length of the weight_array.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../../../src/meta_srv/selector/weighted_choose.rs.html#39-41">Source</a><h4 class="code-header">fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns whether the weight_array is empty.</p>
|
||||
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><section id="impl-WeightedChoose%3CItem%3E-for-RandomWeightedChoose%3CItem%3E" class="impl"><a class="src rightside" href="../../../src/meta_srv/selector/weighted_choose.rs.html#82-112">Source</a><a href="#impl-WeightedChoose%3CItem%3E-for-RandomWeightedChoose%3CItem%3E" class="anchor">§</a><h3 class="code-header">impl<Item> <a class="trait" href="trait.WeightedChoose.html" title="trait meta_srv::selector::weighted_choose::WeightedChoose">WeightedChoose</a><Item> for <a class="struct" href="struct.RandomWeightedChoose.html" title="struct meta_srv::selector::weighted_choose::RandomWeightedChoose">RandomWeightedChoose</a><Item><div class="where">where
|
||||
Item: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section></div><script src="../../../trait.impl/meta_srv/selector/weighted_choose/trait.WeightedChoose.js" async></script></section></div></main></body></html>
|
||||
Reference in New Issue
Block a user