Files
iroh/pr/3118/docs/iroh/endpoint/trait.Controller.html
T

68 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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="Common interface for different congestion controllers"><title>Controller in iroh::endpoint - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Controller</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.clone_box" title="clone_box">clone_box</a></li><li><a href="#tymethod.initial_window" title="initial_window">initial_window</a></li><li><a href="#tymethod.into_any" title="into_any">into_any</a></li><li><a href="#tymethod.on_congestion_event" title="on_congestion_event">on_congestion_event</a></li><li><a href="#tymethod.on_mtu_update" title="on_mtu_update">on_mtu_update</a></li><li><a href="#tymethod.window" title="window">window</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.on_ack" title="on_ack">on_ack</a></li><li><a href="#method.on_end_acks" title="on_end_acks">on_end_acks</a></li><li><a href="#method.on_sent" title="on_sent">on_sent</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>endpoint</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">endpoint</a></span><h1>Trait <span class="trait">Controller</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait Controller: <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.on_congestion_event" class="fn">on_congestion_event</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
sent: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
is_persistent_congestion: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
lost_bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
);
<span class="item-spacer"></span> fn <a href="#tymethod.on_mtu_update" class="fn">on_mtu_update</a>(&amp;mut self, new_mtu: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>);
<span class="item-spacer"></span> fn <a href="#tymethod.window" class="fn">window</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.clone_box" class="fn">clone_box</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="trait.Controller.html" title="trait iroh::endpoint::Controller">Controller</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.initial_window" class="fn">initial_window</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.into_any" class="fn">into_any</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>&gt;;
// Provided methods
fn <a href="#method.on_sent" class="fn">on_sent</a>(&amp;mut self, now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>, bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, last_packet_number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) { ... }
<span class="item-spacer"></span> fn <a href="#method.on_ack" class="fn">on_ack</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
sent: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
app_limited: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
rtt: &amp;RttEstimator,
) { ... }
<span class="item-spacer"></span> fn <a href="#method.on_end_acks" class="fn">on_end_acks</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
in_flight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
app_limited: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
largest_packet_num_acked: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>&gt;,
) { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Common interface for different congestion controllers</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.on_congestion_event" class="method"><h4 class="code-header">fn <a href="#tymethod.on_congestion_event" class="fn">on_congestion_event</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
sent: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
is_persistent_congestion: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
lost_bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
)</h4></section></summary><div class="docblock"><p>Packets were deemed lost or marked congested</p>
<p><code>in_persistent_congestion</code> indicates whether all packets sent within the persistent
congestion threshold period ending when the most recent packet in this batch was sent were
lost.
<code>lost_bytes</code> indicates how many bytes were lost. This value will be 0 for ECN triggers.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_mtu_update" class="method"><h4 class="code-header">fn <a href="#tymethod.on_mtu_update" class="fn">on_mtu_update</a>(&amp;mut self, new_mtu: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>)</h4></section></summary><div class="docblock"><p>The known MTU for the current network path has been updated</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.window" class="method"><h4 class="code-header">fn <a href="#tymethod.window" class="fn">window</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Number of ack-eliciting bytes that may be in flight</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.clone_box" class="method"><h4 class="code-header">fn <a href="#tymethod.clone_box" class="fn">clone_box</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="trait.Controller.html" title="trait iroh::endpoint::Controller">Controller</a>&gt;</h4></section></summary><div class="docblock"><p>Duplicate the controller’s state</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.initial_window" class="method"><h4 class="code-header">fn <a href="#tymethod.initial_window" class="fn">initial_window</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Initial congestion window</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.into_any" class="method"><h4 class="code-header">fn <a href="#tymethod.into_any" class="fn">into_any</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>&gt;</h4></section></summary><div class="docblock"><p>Returns Self for use in down-casting to extract implementation details</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.on_sent" class="method"><h4 class="code-header">fn <a href="#method.on_sent" class="fn">on_sent</a>(&amp;mut self, now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>, bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, last_packet_number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)</h4></section></summary><div class="docblock"><p>One or more packets were just sent</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_ack" class="method"><h4 class="code-header">fn <a href="#method.on_ack" class="fn">on_ack</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
sent: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
app_limited: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
rtt: &amp;RttEstimator,
)</h4></section></summary><div class="docblock"><p>Packet deliveries were confirmed</p>
<p><code>app_limited</code> indicates whether the connection was blocked on outgoing
application data prior to receiving these acknowledgements.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_end_acks" class="method"><h4 class="code-header">fn <a href="#method.on_end_acks" class="fn">on_end_acks</a>(
&amp;mut self,
now: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>,
in_flight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
app_limited: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
largest_packet_num_acked: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>&gt;,
)</h4></section></summary><div class="docblock"><p>Packets are acked in batches, all with the same <code>now</code> argument. This indicates one of those batches has completed.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Controller-for-Bbr" class="impl"><a href="#impl-Controller-for-Bbr" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Controller.html" title="trait iroh::endpoint::Controller">Controller</a> for Bbr</h3></section><section id="impl-Controller-for-Cubic" class="impl"><a href="#impl-Controller-for-Cubic" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Controller.html" title="trait iroh::endpoint::Controller">Controller</a> for Cubic</h3></section><section id="impl-Controller-for-NewReno" class="impl"><a href="#impl-Controller-for-NewReno" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Controller.html" title="trait iroh::endpoint::Controller">Controller</a> for NewReno</h3></section></div><script src="../../trait.impl/iroh_quinn_proto/congestion/trait.Controller.js" data-ignore-extern-crates="iroh_quinn_proto" async></script></section></div></main></body></html>