mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-21 18:53:27 +00:00
deploy: 3faea799a6b52555e9b20dd13c727d6264d53142
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@ increasing time. Specifically, calling <a href="struct.Connection.html#method.ha
|
||||
with events of the same <a href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant"><code>Instant</code></a> may be interleaved in any order with a
|
||||
call to <a href="struct.Connection.html#method.handle_event" title="method iroh_quinn_proto::Connection::handle_event"><code>handle_event</code></a> at that same instant; however
|
||||
events or timeouts with different instants must not be interleaved.</p>
|
||||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Connection" class="impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#363-6411">Source</a><a href="#impl-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.poll_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#524-526">Source</a><h4 class="code-header">pub fn <a href="#method.poll_timeout" class="fn">poll_timeout</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>></h4></section></summary><div class="docblock"><p>Returns the next time at which <code>handle_timeout</code> should be called</p>
|
||||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Connection" class="impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#361-6539">Source</a><a href="#impl-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.poll_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#522-524">Source</a><h4 class="code-header">pub fn <a href="#method.poll_timeout" class="fn">poll_timeout</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>></h4></section></summary><div class="docblock"><p>Returns the next time at which <code>handle_timeout</code> should be called</p>
|
||||
<p>The value returned may change after:</p>
|
||||
<ul>
|
||||
<li>the application performed some I/O on the connection</li>
|
||||
@@ -41,17 +41,17 @@ events or timeouts with different instants must not be interleaved.</p>
|
||||
<li>a call to <code>poll_transmit</code> returned <code>Some</code></li>
|
||||
<li>a call was made to <code>handle_timeout</code></li>
|
||||
</ul>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#534-548">Source</a><h4 class="code-header">pub fn <a href="#method.poll" class="fn">poll</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.Event.html" title="enum iroh_quinn_proto::Event">Event</a>></h4></section></summary><div class="docblock"><p>Returns application-facing events</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#532-546">Source</a><h4 class="code-header">pub fn <a href="#method.poll" class="fn">poll</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.Event.html" title="enum iroh_quinn_proto::Event">Event</a>></h4></section></summary><div class="docblock"><p>Returns application-facing events</p>
|
||||
<p>Connections should be polled for events after:</p>
|
||||
<ul>
|
||||
<li>a call was made to <code>handle_event</code></li>
|
||||
<li>a call was made to <code>handle_timeout</code></li>
|
||||
</ul>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_endpoint_events" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#552-554">Source</a><h4 class="code-header">pub fn <a href="#method.poll_endpoint_events" class="fn">poll_endpoint_events</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.EndpointEvent.html" title="struct iroh_quinn_proto::EndpointEvent">EndpointEvent</a>></h4></section></summary><div class="docblock"><p>Return endpoint-facing events</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#558-563">Source</a><h4 class="code-header">pub fn <a href="#method.streams" class="fn">streams</a>(&mut self) -> <a class="struct" href="struct.Streams.html" title="struct iroh_quinn_proto::Streams">Streams</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.recv_stream" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#567-574">Source</a><h4 class="code-header">pub fn <a href="#method.recv_stream" class="fn">recv_stream</a>(&mut self, id: <a class="struct" href="struct.StreamId.html" title="struct iroh_quinn_proto::StreamId">StreamId</a>) -> <a class="struct" href="struct.RecvStream.html" title="struct iroh_quinn_proto::RecvStream">RecvStream</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.send_stream" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#578-586">Source</a><h4 class="code-header">pub fn <a href="#method.send_stream" class="fn">send_stream</a>(&mut self, id: <a class="struct" href="struct.StreamId.html" title="struct iroh_quinn_proto::StreamId">StreamId</a>) -> <a class="struct" href="struct.SendStream.html" title="struct iroh_quinn_proto::SendStream">SendStream</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.open_path_ensure" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#604-618">Source</a><h4 class="code-header">pub fn <a href="#method.open_path_ensure" class="fn">open_path_ensure</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_endpoint_events" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#550-552">Source</a><h4 class="code-header">pub fn <a href="#method.poll_endpoint_events" class="fn">poll_endpoint_events</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.EndpointEvent.html" title="struct iroh_quinn_proto::EndpointEvent">EndpointEvent</a>></h4></section></summary><div class="docblock"><p>Return endpoint-facing events</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#556-561">Source</a><h4 class="code-header">pub fn <a href="#method.streams" class="fn">streams</a>(&mut self) -> <a class="struct" href="struct.Streams.html" title="struct iroh_quinn_proto::Streams">Streams</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.recv_stream" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#565-572">Source</a><h4 class="code-header">pub fn <a href="#method.recv_stream" class="fn">recv_stream</a>(&mut self, id: <a class="struct" href="struct.StreamId.html" title="struct iroh_quinn_proto::StreamId">StreamId</a>) -> <a class="struct" href="struct.RecvStream.html" title="struct iroh_quinn_proto::RecvStream">RecvStream</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.send_stream" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#576-584">Source</a><h4 class="code-header">pub fn <a href="#method.send_stream" class="fn">send_stream</a>(&mut self, id: <a class="struct" href="struct.StreamId.html" title="struct iroh_quinn_proto::StreamId">StreamId</a>) -> <a class="struct" href="struct.SendStream.html" title="struct iroh_quinn_proto::SendStream">SendStream</a><'_></h4></section></summary><div class="docblock"><p>Provide control over streams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.open_path_ensure" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#602-616">Source</a><h4 class="code-header">pub fn <a href="#method.open_path_ensure" class="fn">open_path_ensure</a>(
|
||||
&mut self,
|
||||
network_path: <a class="struct" href="struct.FourTuple.html" title="struct iroh_quinn_proto::FourTuple">FourTuple</a>,
|
||||
initial_status: <a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>,
|
||||
@@ -65,7 +65,7 @@ remote addresses.</p>
|
||||
remote, should it not be known yet. We assume that if we already have a path to the remote,
|
||||
the OS is likely to use the same interface to talk to said remote.</p>
|
||||
<p>See also <a href="struct.Connection.html#method.open_path" title="method iroh_quinn_proto::Connection::open_path"><code>open_path</code></a>. Returns <code>(path_id, true)</code> if the path already existed. <code>(path_id, false)</code> if was opened.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.open_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#624-663">Source</a><h4 class="code-header">pub fn <a href="#method.open_path" class="fn">open_path</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.open_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#622-661">Source</a><h4 class="code-header">pub fn <a href="#method.open_path" class="fn">open_path</a>(
|
||||
&mut self,
|
||||
network_path: <a class="struct" href="struct.FourTuple.html" title="struct iroh_quinn_proto::FourTuple">FourTuple</a>,
|
||||
initial_status: <a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>,
|
||||
@@ -73,7 +73,7 @@ the OS is likely to use the same interface to talk to said remote.</p>
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>, <a class="enum" href="enum.PathError.html" title="enum iroh_quinn_proto::PathError">PathError</a>></h4></section></summary><div class="docblock"><p>Opens a new path</p>
|
||||
<p>Further errors might occur and they will be emitted in <a href="enum.PathEvent.html#variant.LocallyClosed" title="variant iroh_quinn_proto::PathEvent::LocallyClosed"><code>PathEvent::LocallyClosed</code></a> events.
|
||||
When the path is opened it will be reported as an <a href="enum.PathEvent.html#variant.Opened" title="variant iroh_quinn_proto::PathEvent::Opened"><code>PathEvent::Opened</code></a>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.close_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#670-731">Source</a><h4 class="code-header">pub fn <a href="#method.close_path" class="fn">close_path</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.close_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#668-729">Source</a><h4 class="code-header">pub fn <a href="#method.close_path" class="fn">close_path</a>(
|
||||
&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>,
|
||||
path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>,
|
||||
@@ -82,32 +82,32 @@ When the path is opened it will be reported as an <a href="enum.PathEvent.html#v
|
||||
<p>This will not allow closing the last path. It does allow closing paths which have
|
||||
not yet been opened, as e.g. is the case when receiving a PATH_ABANDON from the peer
|
||||
for a path that was never opened locally.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.paths" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#763-765">Source</a><h4 class="code-header">pub fn <a href="#method.paths" class="fn">paths</a>(&self) -> <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="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>></h4></section></summary><div class="docblock"><p>Returns all known paths.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.paths" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#761-763">Source</a><h4 class="code-header">pub fn <a href="#method.paths" class="fn">paths</a>(&self) -> <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="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>></h4></section></summary><div class="docblock"><p>Returns all known paths.</p>
|
||||
<p>There is no guarantee any of these paths are open or usable.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#768-772">Source</a><h4 class="code-header">pub fn <a href="#method.path_status" class="fn">path_status</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Gets the local <a href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus"><code>PathStatus</code></a> for a known <a href="struct.PathId.html" title="struct iroh_quinn_proto::PathId"><code>PathId</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.network_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#775-779">Source</a><h4 class="code-header">pub fn <a href="#method.network_path" class="fn">network_path</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.FourTuple.html" title="struct iroh_quinn_proto::FourTuple">FourTuple</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Returns the path’s network path represented as a 4-tuple.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#784-806">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_status" class="fn">set_path_status</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#766-770">Source</a><h4 class="code-header">pub fn <a href="#method.path_status" class="fn">path_status</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Gets the local <a href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus"><code>PathStatus</code></a> for a known <a href="struct.PathId.html" title="struct iroh_quinn_proto::PathId"><code>PathId</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.network_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#773-777">Source</a><h4 class="code-header">pub fn <a href="#method.network_path" class="fn">network_path</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.FourTuple.html" title="struct iroh_quinn_proto::FourTuple">FourTuple</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Returns the path’s network path represented as a 4-tuple.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#782-804">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_status" class="fn">set_path_status</a>(
|
||||
&mut self,
|
||||
path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>,
|
||||
status: <a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>, <a class="enum" href="enum.SetPathStatusError.html" title="enum iroh_quinn_proto::SetPathStatusError">SetPathStatusError</a>></h4></section></summary><div class="docblock"><p>Sets the <a href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus"><code>PathStatus</code></a> for a known <a href="struct.PathId.html" title="struct iroh_quinn_proto::PathId"><code>PathId</code></a></p>
|
||||
<p>Returns the previous path status on success.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remote_path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#812-814">Source</a><h4 class="code-header">pub fn <a href="#method.remote_path_status" class="fn">remote_path_status</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>></h4></section></summary><div class="docblock"><p>Returns the remote path status</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_max_idle_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#821-831">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_max_idle_timeout" class="fn">set_path_max_idle_timeout</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remote_path_status" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#810-812">Source</a><h4 class="code-header">pub fn <a href="#method.remote_path_status" class="fn">remote_path_status</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.PathStatus.html" title="enum iroh_quinn_proto::PathStatus">PathStatus</a>></h4></section></summary><div class="docblock"><p>Returns the remote path status</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_max_idle_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#819-829">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_max_idle_timeout" class="fn">set_path_max_idle_timeout</a>(
|
||||
&mut self,
|
||||
path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>,
|
||||
timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Sets the max_idle_timeout for a specific path</p>
|
||||
<p>See <a href="struct.TransportConfig.html#method.default_path_max_idle_timeout" title="method iroh_quinn_proto::TransportConfig::default_path_max_idle_timeout"><code>TransportConfig::default_path_max_idle_timeout</code></a> for details.</p>
|
||||
<p>Returns the previous value of the setting.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_keep_alive_interval" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#838-848">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_keep_alive_interval" class="fn">set_path_keep_alive_interval</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_path_keep_alive_interval" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#836-846">Source</a><h4 class="code-header">pub fn <a href="#method.set_path_keep_alive_interval" class="fn">set_path_keep_alive_interval</a>(
|
||||
&mut self,
|
||||
path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>,
|
||||
interval: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Sets the keep_alive_interval for a specific path</p>
|
||||
<p>See <a href="struct.TransportConfig.html#method.default_path_keep_alive_interval" title="method iroh_quinn_proto::TransportConfig::default_path_keep_alive_interval"><code>TransportConfig::default_path_keep_alive_interval</code></a> for details.</p>
|
||||
<p>Returns the previous value of the setting.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_transmit" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#945-1098">Source</a><h4 class="code-header">pub fn <a href="#method.poll_transmit" class="fn">poll_transmit</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_transmit" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#943-1096">Source</a><h4 class="code-header">pub fn <a href="#method.poll_transmit" class="fn">poll_transmit</a>(
|
||||
&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>,
|
||||
max_datagrams: <a class="type" href="https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroUsize.html" title="type core::num::nonzero::NonZeroUsize">NonZeroUsize</a>,
|
||||
@@ -121,60 +121,60 @@ for a path that was never opened locally.</p>
|
||||
</ul>
|
||||
<p><code>max_datagrams</code> specifies how many datagrams can be returned inside a
|
||||
single Transmit using GSO. This must be at least 1.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.handle_event" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#1847-1918">Source</a><h4 class="code-header">pub fn <a href="#method.handle_event" class="fn">handle_event</a>(&mut self, event: <a class="struct" href="struct.ConnectionEvent.html" title="struct iroh_quinn_proto::ConnectionEvent">ConnectionEvent</a>)</h4></section></summary><div class="docblock"><p>Process <code>ConnectionEvent</code>s generated by the associated <code>Endpoint</code></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.handle_event" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#1975-2046">Source</a><h4 class="code-header">pub fn <a href="#method.handle_event" class="fn">handle_event</a>(&mut self, event: <a class="struct" href="struct.ConnectionEvent.html" title="struct iroh_quinn_proto::ConnectionEvent">ConnectionEvent</a>)</h4></section></summary><div class="docblock"><p>Process <code>ConnectionEvent</code>s generated by the associated <code>Endpoint</code></p>
|
||||
<p>Will execute protocol logic upon receipt of a connection event, in turn preparing signals
|
||||
(including application <code>Event</code>s, <code>EndpointEvent</code>s and outgoing datagrams) that should be
|
||||
extracted through the relevant methods.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.handle_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#1992-2138">Source</a><h4 class="code-header">pub fn <a href="#method.handle_timeout" class="fn">handle_timeout</a>(&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>)</h4></section></summary><div class="docblock"><p>Process timer expirations</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.handle_timeout" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2120-2266">Source</a><h4 class="code-header">pub fn <a href="#method.handle_timeout" class="fn">handle_timeout</a>(&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>)</h4></section></summary><div class="docblock"><p>Process timer expirations</p>
|
||||
<p>Executes protocol logic, potentially preparing signals (including application <code>Event</code>s,
|
||||
<code>EndpointEvent</code>s and outgoing datagrams) that should be extracted through the relevant
|
||||
methods.</p>
|
||||
<p>It is most efficient to call this immediately after the system clock reaches the latest
|
||||
<code>Instant</code> that was output by <code>poll_timeout</code>; however spurious extra calls will simply
|
||||
no-op and therefore are safe.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.close" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2151-2156">Source</a><h4 class="code-header">pub fn <a href="#method.close" class="fn">close</a>(&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>, error_code: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>, reason: Bytes)</h4></section></summary><div class="docblock"><p>Close a connection immediately</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.close" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2279-2284">Source</a><h4 class="code-header">pub fn <a href="#method.close" class="fn">close</a>(&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>, error_code: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>, reason: Bytes)</h4></section></summary><div class="docblock"><p>Close a connection immediately</p>
|
||||
<p>This does not ensure delivery of outstanding data. It is the application’s responsibility to
|
||||
call this only when all important communications have been completed, e.g. by calling
|
||||
<a href="struct.SendStream.html#method.finish" title="method iroh_quinn_proto::SendStream::finish"><code>SendStream::finish</code></a> on outstanding streams and waiting for the corresponding
|
||||
<a href="enum.StreamEvent.html#variant.Finished" title="variant iroh_quinn_proto::StreamEvent::Finished"><code>StreamEvent::Finished</code></a> event.</p>
|
||||
<p>If <a href="struct.Streams.html#method.send_streams" title="method iroh_quinn_proto::Streams::send_streams"><code>Streams::send_streams</code></a> returns 0, all outstanding stream data has been
|
||||
delivered. There may still be data from the peer that has not been received.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.datagrams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2169-2171">Source</a><h4 class="code-header">pub fn <a href="#method.datagrams" class="fn">datagrams</a>(&mut self) -> <a class="struct" href="struct.Datagrams.html" title="struct iroh_quinn_proto::Datagrams">Datagrams</a><'_></h4></section></summary><div class="docblock"><p>Control datagrams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.stats" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2174-2176">Source</a><h4 class="code-header">pub fn <a href="#method.stats" class="fn">stats</a>(&mut self) -> <a class="struct" href="struct.ConnectionStats.html" title="struct iroh_quinn_proto::ConnectionStats">ConnectionStats</a></h4></section></summary><div class="docblock"><p>Returns connection statistics</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_stats" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2179-2186">Source</a><h4 class="code-header">pub fn <a href="#method.path_stats" class="fn">path_stats</a>(&mut self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.PathStats.html" title="struct iroh_quinn_proto::PathStats">PathStats</a>></h4></section></summary><div class="docblock"><p>Returns path statistics</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ping" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2191-2197">Source</a><h4 class="code-header">pub fn <a href="#method.ping" class="fn">ping</a>(&mut self)</h4></section></summary><div class="docblock"><p>Ping the remote endpoint</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.datagrams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2297-2299">Source</a><h4 class="code-header">pub fn <a href="#method.datagrams" class="fn">datagrams</a>(&mut self) -> <a class="struct" href="struct.Datagrams.html" title="struct iroh_quinn_proto::Datagrams">Datagrams</a><'_></h4></section></summary><div class="docblock"><p>Control datagrams</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.stats" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2302-2304">Source</a><h4 class="code-header">pub fn <a href="#method.stats" class="fn">stats</a>(&mut self) -> <a class="struct" href="struct.ConnectionStats.html" title="struct iroh_quinn_proto::ConnectionStats">ConnectionStats</a></h4></section></summary><div class="docblock"><p>Returns connection statistics</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_stats" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2307-2314">Source</a><h4 class="code-header">pub fn <a href="#method.path_stats" class="fn">path_stats</a>(&mut self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.PathStats.html" title="struct iroh_quinn_proto::PathStats">PathStats</a>></h4></section></summary><div class="docblock"><p>Returns path statistics</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ping" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2319-2325">Source</a><h4 class="code-header">pub fn <a href="#method.ping" class="fn">ping</a>(&mut self)</h4></section></summary><div class="docblock"><p>Ping the remote endpoint</p>
|
||||
<p>Causes an ACK-eliciting packet to be transmitted on the connection.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ping_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2202-2209">Source</a><h4 class="code-header">pub fn <a href="#method.ping_path" class="fn">ping_path</a>(&mut self, path: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Ping the remote endpoint over a specific path</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ping_path" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2330-2337">Source</a><h4 class="code-header">pub fn <a href="#method.ping_path" class="fn">ping_path</a>(&mut self, path: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Ping the remote endpoint over a specific path</p>
|
||||
<p>Causes an ACK-eliciting packet to be transmitted on the path.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.force_key_update" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2214-2226">Source</a><h4 class="code-header">pub fn <a href="#method.force_key_update" class="fn">force_key_update</a>(&mut self)</h4></section></summary><div class="docblock"><p>Update traffic keys spontaneously</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.force_key_update" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2342-2354">Source</a><h4 class="code-header">pub fn <a href="#method.force_key_update" class="fn">force_key_update</a>(&mut self)</h4></section></summary><div class="docblock"><p>Update traffic keys spontaneously</p>
|
||||
<p>This can be useful for testing key updates, as they otherwise only happen infrequently.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.crypto_session" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2229-2231">Source</a><h4 class="code-header">pub fn <a href="#method.crypto_session" class="fn">crypto_session</a>(&self) -> &dyn <a class="trait" href="crypto/trait.Session.html" title="trait iroh_quinn_proto::crypto::Session">Session</a></h4></section></summary><div class="docblock"><p>Get a session reference</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_handshaking" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2237-2239">Source</a><h4 class="code-header">pub fn <a href="#method.is_handshaking" class="fn">is_handshaking</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>Whether the connection is in the process of being established</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.crypto_session" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2357-2359">Source</a><h4 class="code-header">pub fn <a href="#method.crypto_session" class="fn">crypto_session</a>(&self) -> &dyn <a class="trait" href="crypto/trait.Session.html" title="trait iroh_quinn_proto::crypto::Session">Session</a></h4></section></summary><div class="docblock"><p>Get a session reference</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_handshaking" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2365-2367">Source</a><h4 class="code-header">pub fn <a href="#method.is_handshaking" class="fn">is_handshaking</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>Whether the connection is in the process of being established</p>
|
||||
<p>If this returns <code>false</code>, the connection may be either established or closed, signaled by the
|
||||
emission of a <code>Connected</code> or <code>ConnectionLost</code> message respectively.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_closed" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2248-2250">Source</a><h4 class="code-header">pub fn <a href="#method.is_closed" class="fn">is_closed</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>Whether the connection is closed</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_closed" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2376-2378">Source</a><h4 class="code-header">pub fn <a href="#method.is_closed" class="fn">is_closed</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>Whether the connection is closed</p>
|
||||
<p>Closed connections cannot transport any further data. A connection becomes closed when
|
||||
either peer application intentionally closes it, or when either transport layer detects an
|
||||
error such as a time-out or certificate validation failure.</p>
|
||||
<p>A <code>ConnectionLost</code> event is emitted with details when the connection becomes closed.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_drained" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2256-2258">Source</a><h4 class="code-header">pub fn <a href="#method.is_drained" class="fn">is_drained</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>Whether there is no longer any need to keep the connection around</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_drained" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2384-2386">Source</a><h4 class="code-header">pub fn <a href="#method.is_drained" class="fn">is_drained</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>Whether there is no longer any need to keep the connection around</p>
|
||||
<p>Closed connections become drained after a brief timeout to absorb any remaining in-flight
|
||||
packets from the peer. All drained connections have been closed.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.accepted_0rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2263-2265">Source</a><h4 class="code-header">pub fn <a href="#method.accepted_0rtt" class="fn">accepted_0rtt</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>For clients, if the peer accepted the 0-RTT data packets</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.accepted_0rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2391-2393">Source</a><h4 class="code-header">pub fn <a href="#method.accepted_0rtt" class="fn">accepted_0rtt</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>For clients, if the peer accepted the 0-RTT data packets</p>
|
||||
<p>The value is meaningless until after the handshake completes.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_0rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2268-2270">Source</a><h4 class="code-header">pub fn <a href="#method.has_0rtt" class="fn">has_0rtt</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>Whether 0-RTT is/was possible during the handshake</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_pending_retransmits" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2273-2275">Source</a><h4 class="code-header">pub fn <a href="#method.has_pending_retransmits" class="fn">has_pending_retransmits</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>Whether there are any pending retransmits</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.side" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2278-2280">Source</a><h4 class="code-header">pub fn <a href="#method.side" class="fn">side</a>(&self) -> <a class="enum" href="enum.Side.html" title="enum iroh_quinn_proto::Side">Side</a></h4></section></summary><div class="docblock"><p>Look up whether we’re the client or server of this Connection</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_observed_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2283-2292">Source</a><h4 class="code-header">pub fn <a href="#method.path_observed_address" class="fn">path_observed_address</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_0rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2396-2398">Source</a><h4 class="code-header">pub fn <a href="#method.has_0rtt" class="fn">has_0rtt</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>Whether 0-RTT is/was possible during the handshake</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_pending_retransmits" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2401-2403">Source</a><h4 class="code-header">pub fn <a href="#method.has_pending_retransmits" class="fn">has_pending_retransmits</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>Whether there are any pending retransmits</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.side" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2406-2408">Source</a><h4 class="code-header">pub fn <a href="#method.side" class="fn">side</a>(&self) -> <a class="enum" href="enum.Side.html" title="enum iroh_quinn_proto::Side">Side</a></h4></section></summary><div class="docblock"><p>Look up whether we’re the client or server of this Connection</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_observed_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2411-2420">Source</a><h4 class="code-header">pub fn <a href="#method.path_observed_address" class="fn">path_observed_address</a>(
|
||||
&self,
|
||||
path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>>, <a class="struct" href="struct.ClosedPath.html" title="struct iroh_quinn_proto::ClosedPath">ClosedPath</a>></h4></section></summary><div class="docblock"><p>Get the address observed by the remote over the given path</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2295-2297">Source</a><h4 class="code-header">pub fn <a href="#method.rtt" class="fn">rtt</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>></h4></section></summary><div class="docblock"><p>Current best estimate of this connection’s latency (round-trip-time)</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.congestion_state" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2300-2302">Source</a><h4 class="code-header">pub fn <a href="#method.congestion_state" class="fn">congestion_state</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="congestion/trait.Controller.html" title="trait iroh_quinn_proto::congestion::Controller">Controller</a>></h4></section></summary><div class="docblock"><p>Current state of this connection’s congestion controller, for debugging purposes</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_max_concurrent_streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2308-2314">Source</a><h4 class="code-header">pub fn <a href="#method.set_max_concurrent_streams" class="fn">set_max_concurrent_streams</a>(&mut self, dir: <a class="enum" href="enum.Dir.html" title="enum iroh_quinn_proto::Dir">Dir</a>, count: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>)</h4></section></summary><div class="docblock"><p>Modify the number of remotely initiated streams that may be concurrently open</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rtt" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2423-2425">Source</a><h4 class="code-header">pub fn <a href="#method.rtt" class="fn">rtt</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>></h4></section></summary><div class="docblock"><p>Current best estimate of this connection’s latency (round-trip-time)</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.congestion_state" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2428-2430">Source</a><h4 class="code-header">pub fn <a href="#method.congestion_state" class="fn">congestion_state</a>(&self, path_id: <a class="struct" href="struct.PathId.html" title="struct iroh_quinn_proto::PathId">PathId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="congestion/trait.Controller.html" title="trait iroh_quinn_proto::congestion::Controller">Controller</a>></h4></section></summary><div class="docblock"><p>Current state of this connection’s congestion controller, for debugging purposes</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_max_concurrent_streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2436-2442">Source</a><h4 class="code-header">pub fn <a href="#method.set_max_concurrent_streams" class="fn">set_max_concurrent_streams</a>(&mut self, dir: <a class="enum" href="enum.Dir.html" title="enum iroh_quinn_proto::Dir">Dir</a>, count: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>)</h4></section></summary><div class="docblock"><p>Modify the number of remotely initiated streams that may be concurrently open</p>
|
||||
<p>No streams may be opened by the peer unless fewer than <code>count</code> are already open. Large
|
||||
<code>count</code>s increase both minimum and worst-case memory consumption.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_max_concurrent_paths" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2325-2346">Source</a><h4 class="code-header">pub fn <a href="#method.set_max_concurrent_paths" class="fn">set_max_concurrent_paths</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_max_concurrent_paths" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2453-2474">Source</a><h4 class="code-header">pub fn <a href="#method.set_max_concurrent_paths" class="fn">set_max_concurrent_paths</a>(
|
||||
&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>,
|
||||
count: <a class="type" href="https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU32.html" title="type core::num::nonzero::NonZeroU32">NonZeroU32</a>,
|
||||
@@ -185,36 +185,36 @@ actively reduce paths they must be closed using <a href="struct.Connection.html#
|
||||
can also be used to close not-yet-opened paths.</p>
|
||||
<p>If multipath is not negotiated (see the <a href="struct.TransportConfig.html" title="struct iroh_quinn_proto::TransportConfig"><code>TransportConfig</code></a>) this can not enable
|
||||
multipath and will fail.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.max_concurrent_streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2365-2367">Source</a><h4 class="code-header">pub fn <a href="#method.max_concurrent_streams" class="fn">max_concurrent_streams</a>(&self, dir: <a class="enum" href="enum.Dir.html" title="enum iroh_quinn_proto::Dir">Dir</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Current number of remotely initiated streams that may be concurrently open</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.max_concurrent_streams" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2493-2495">Source</a><h4 class="code-header">pub fn <a href="#method.max_concurrent_streams" class="fn">max_concurrent_streams</a>(&self, dir: <a class="enum" href="enum.Dir.html" title="enum iroh_quinn_proto::Dir">Dir</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Current number of remotely initiated streams that may be concurrently open</p>
|
||||
<p>If the target for this limit is reduced using <a href="struct.Connection.html#method.set_max_concurrent_streams" title="method iroh_quinn_proto::Connection::set_max_concurrent_streams"><code>set_max_concurrent_streams</code></a>,
|
||||
it will not change immediately, even if fewer streams are open. Instead, it will
|
||||
decrement by one for each time a remotely initiated stream of matching directionality is closed.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_send_window" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2370-2372">Source</a><h4 class="code-header">pub fn <a href="#method.set_send_window" class="fn">set_send_window</a>(&mut self, send_window: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)</h4></section></summary><div class="docblock"><p>See <a href="struct.TransportConfig.html#method.send_window" title="method iroh_quinn_proto::TransportConfig::send_window"><code>TransportConfig::send_window()</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_receive_window" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2375-2379">Source</a><h4 class="code-header">pub fn <a href="#method.set_receive_window" class="fn">set_receive_window</a>(&mut self, receive_window: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>)</h4></section></summary><div class="docblock"><p>See <a href="struct.TransportConfig.html#method.receive_window" title="method iroh_quinn_proto::TransportConfig::receive_window"><code>TransportConfig::receive_window()</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_multipath_negotiated" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2385-2389">Source</a><h4 class="code-header">pub fn <a href="#method.is_multipath_negotiated" class="fn">is_multipath_negotiated</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>Whether the Multipath for QUIC extension is enabled.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_send_window" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2498-2500">Source</a><h4 class="code-header">pub fn <a href="#method.set_send_window" class="fn">set_send_window</a>(&mut self, send_window: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)</h4></section></summary><div class="docblock"><p>See <a href="struct.TransportConfig.html#method.send_window" title="method iroh_quinn_proto::TransportConfig::send_window"><code>TransportConfig::send_window()</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_receive_window" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2503-2507">Source</a><h4 class="code-header">pub fn <a href="#method.set_receive_window" class="fn">set_receive_window</a>(&mut self, receive_window: <a class="struct" href="struct.VarInt.html" title="struct iroh_quinn_proto::VarInt">VarInt</a>)</h4></section></summary><div class="docblock"><p>See <a href="struct.TransportConfig.html#method.receive_window" title="method iroh_quinn_proto::TransportConfig::receive_window"><code>TransportConfig::receive_window()</code></a></p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_multipath_negotiated" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#2513-2517">Source</a><h4 class="code-header">pub fn <a href="#method.is_multipath_negotiated" class="fn">is_multipath_negotiated</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>Whether the Multipath for QUIC extension is enabled.</p>
|
||||
<p>Multipath is only enabled after the handshake is completed and if it was enabled by both
|
||||
peers.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.local_address_changed" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#5033-5037">Source</a><h4 class="code-header">pub fn <a href="#method.local_address_changed" class="fn">local_address_changed</a>(&mut self)</h4></section></summary><div class="docblock"><p>Handle a change in the local address, i.e. an active migration</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.current_mtu" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6109-6116">Source</a><h4 class="code-header">pub fn <a href="#method.current_mtu" class="fn">current_mtu</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Storage size required for the largest packet that can be transmitted on all currently
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.local_address_changed" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#5161-5165">Source</a><h4 class="code-header">pub fn <a href="#method.local_address_changed" class="fn">local_address_changed</a>(&mut self)</h4></section></summary><div class="docblock"><p>Handle a change in the local address, i.e. an active migration</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.current_mtu" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6237-6244">Source</a><h4 class="code-header">pub fn <a href="#method.current_mtu" class="fn">current_mtu</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Storage size required for the largest packet that can be transmitted on all currently
|
||||
available paths</p>
|
||||
<p>Buffers passed to <a href="struct.Connection.html#method.poll_transmit" title="method iroh_quinn_proto::Connection::poll_transmit"><code>Connection::poll_transmit</code></a> should be at least this large.</p>
|
||||
<p>When multipath is enabled, this value is the minimum MTU across all available paths.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_nat_traversal_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6216-6221">Source</a><h4 class="code-header">pub fn <a href="#method.add_nat_traversal_address" class="fn">add_nat_traversal_address</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_nat_traversal_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6344-6349">Source</a><h4 class="code-header">pub fn <a href="#method.add_nat_traversal_address" class="fn">add_nat_traversal_address</a>(
|
||||
&mut self,
|
||||
address: <a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="iroh_hp/enum.Error.html" title="enum iroh_quinn_proto::iroh_hp::Error">Error</a>></h4></section></summary><div class="docblock"><p>Add addresses the local endpoint considers are reachable for nat traversal</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_nat_traversal_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6226-6237">Source</a><h4 class="code-header">pub fn <a href="#method.remove_nat_traversal_address" class="fn">remove_nat_traversal_address</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_nat_traversal_address" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6354-6365">Source</a><h4 class="code-header">pub fn <a href="#method.remove_nat_traversal_address" class="fn">remove_nat_traversal_address</a>(
|
||||
&mut self,
|
||||
address: <a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="iroh_hp/enum.Error.html" title="enum iroh_quinn_proto::iroh_hp::Error">Error</a>></h4></section></summary><div class="docblock"><p>Removes an address the endpoing no longer considers reachable for nat traversal</p>
|
||||
<p>Addresses not present in the set will be silently ignored.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_local_nat_traversal_addresses" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6240-6242">Source</a><h4 class="code-header">pub fn <a href="#method.get_local_nat_traversal_addresses" class="fn">get_local_nat_traversal_addresses</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_local_nat_traversal_addresses" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6368-6370">Source</a><h4 class="code-header">pub fn <a href="#method.get_local_nat_traversal_addresses" class="fn">get_local_nat_traversal_addresses</a>(
|
||||
&self,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::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><<a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>>, <a class="enum" href="iroh_hp/enum.Error.html" title="enum iroh_quinn_proto::iroh_hp::Error">Error</a>></h4></section></summary><div class="docblock"><p>Get the current local nat traversal addresses</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_remote_nat_traversal_addresses" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6245-6250">Source</a><h4 class="code-header">pub fn <a href="#method.get_remote_nat_traversal_addresses" class="fn">get_remote_nat_traversal_addresses</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_remote_nat_traversal_addresses" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6373-6378">Source</a><h4 class="code-header">pub fn <a href="#method.get_remote_nat_traversal_addresses" class="fn">get_remote_nat_traversal_addresses</a>(
|
||||
&self,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::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><<a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>>, <a class="enum" href="iroh_hp/enum.Error.html" title="enum iroh_quinn_proto::iroh_hp::Error">Error</a>></h4></section></summary><div class="docblock"><p>Get the currently advertised nat traversal addresses by the server</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.initiate_nat_traversal_round" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6306-6382">Source</a><h4 class="code-header">pub fn <a href="#method.initiate_nat_traversal_round" class="fn">initiate_nat_traversal_round</a>(
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.initiate_nat_traversal_round" class="method"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6434-6510">Source</a><h4 class="code-header">pub fn <a href="#method.initiate_nat_traversal_round" class="fn">initiate_nat_traversal_round</a>(
|
||||
&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>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::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><<a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>>, <a class="enum" href="iroh_hp/enum.Error.html" title="enum iroh_quinn_proto::iroh_hp::Error">Error</a>></h4></section></summary><div class="docblock"><p>Initiates a new nat traversal round</p>
|
||||
@@ -224,7 +224,7 @@ initiated, the previous one is cancelled, and paths that have not been opened ar
|
||||
<p>Returns the server addresses that are now being probed.
|
||||
If addresses fail due to spurious errors, these might succeed later and not be returned in
|
||||
this set.</p>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Connection" class="impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6413-6419">Source</a><a href="#impl-Debug-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6414-6418">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Connection" class="impl"><a href="#impl-Freeze-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-RefUnwindSafe-for-Connection" class="impl"><a href="#impl-RefUnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Send-for-Connection" class="impl"><a href="#impl-Send-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Sync-for-Connection" class="impl"><a href="#impl-Sync-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Unpin-for-Connection" class="impl"><a href="#impl-Unpin-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-UnwindSafe-for-Connection" class="impl"><a href="#impl-UnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Connection" class="impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6541-6547">Source</a><a href="#impl-Debug-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/iroh_quinn_proto/connection/mod.rs.html#6542-6546">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Connection" class="impl"><a href="#impl-Freeze-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-RefUnwindSafe-for-Connection" class="impl"><a href="#impl-RefUnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Send-for-Connection" class="impl"><a href="#impl-Send-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Sync-for-Connection" class="impl"><a href="#impl-Sync-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-Unpin-for-Connection" class="impl"><a href="#impl-Unpin-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section><section id="impl-UnwindSafe-for-Connection" class="impl"><a href="#impl-UnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct iroh_quinn_proto::Connection">Connection</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -282,7 +282,7 @@
|
||||
<a href=#282 id=282 data-nosnippet>282</a> conn: <span class="kw-2">&mut </span>Connection,
|
||||
<a href=#283 id=283 data-nosnippet>283</a> path_id: PathId,
|
||||
<a href=#284 id=284 data-nosnippet>284</a> pad_datagram: PadDatagram,
|
||||
<a href=#285 id=285 data-nosnippet>285</a> ) {
|
||||
<a href=#285 id=285 data-nosnippet>285</a> ) -> u64 {
|
||||
<a href=#286 id=286 data-nosnippet>286</a> <span class="kw">match </span>pad_datagram {
|
||||
<a href=#287 id=287 data-nosnippet>287</a> PadDatagram::No => (),
|
||||
<a href=#288 id=288 data-nosnippet>288</a> PadDatagram::ToSize(size) => <span class="self">self</span>.pad_to(size),
|
||||
@@ -329,121 +329,123 @@
|
||||
<a href=#329 id=329 data-nosnippet>329</a> conn.set_loss_detection_timer(now, path_id);
|
||||
<a href=#330 id=330 data-nosnippet>330</a> conn.path_data_mut(path_id).pacing.on_transmit(size);
|
||||
<a href=#331 id=331 data-nosnippet>331</a> }
|
||||
<a href=#332 id=332 data-nosnippet>332</a> }
|
||||
<a href=#333 id=333 data-nosnippet>333</a>
|
||||
<a href=#334 id=334 data-nosnippet>334</a> <span class="doccomment">/// Encrypt packet, returning the length of the packet and whether padding was added
|
||||
<a href=#335 id=335 data-nosnippet>335</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>finish(
|
||||
<a href=#336 id=336 data-nosnippet>336</a> <span class="kw-2">mut </span><span class="self">self</span>,
|
||||
<a href=#337 id=337 data-nosnippet>337</a> conn: <span class="kw-2">&mut </span>Connection,
|
||||
<a href=#338 id=338 data-nosnippet>338</a> now: Instant,
|
||||
<a href=#339 id=339 data-nosnippet>339</a> ) -> (usize, bool, SentFrames) {
|
||||
<a href=#340 id=340 data-nosnippet>340</a> <span class="macro">debug_assert!</span>(
|
||||
<a href=#341 id=341 data-nosnippet>341</a> <span class="self">self</span>.buf.len() <= <span class="self">self</span>.buf.datagram_max_offset() - <span class="self">self</span>.tag_len,
|
||||
<a href=#342 id=342 data-nosnippet>342</a> <span class="string">"packet exceeds maximum size"
|
||||
<a href=#343 id=343 data-nosnippet>343</a> </span>);
|
||||
<a href=#344 id=344 data-nosnippet>344</a> <span class="kw">let </span>pad = <span class="self">self</span>.buf.len() < <span class="self">self</span>.min_size;
|
||||
<a href=#345 id=345 data-nosnippet>345</a> <span class="kw">if </span>pad {
|
||||
<a href=#346 id=346 data-nosnippet>346</a> <span class="kw">let </span>padding = <span class="self">self</span>.min_size - <span class="self">self</span>.buf.len();
|
||||
<a href=#347 id=347 data-nosnippet>347</a> <span class="macro">trace!</span>(<span class="string">"PADDING * {}"</span>, padding);
|
||||
<a href=#348 id=348 data-nosnippet>348</a> <span class="self">self</span>.buf.put_bytes(<span class="number">0</span>, padding);
|
||||
<a href=#349 id=349 data-nosnippet>349</a> <span class="self">self</span>.qlog.frame_padding(padding);
|
||||
<a href=#350 id=350 data-nosnippet>350</a> }
|
||||
<a href=#351 id=351 data-nosnippet>351</a>
|
||||
<a href=#352 id=352 data-nosnippet>352</a> <span class="kw">let </span>space = <span class="kw-2">&</span>conn.spaces[<span class="self">self</span>.space];
|
||||
<a href=#353 id=353 data-nosnippet>353</a> <span class="kw">let </span>(header_crypto, packet_crypto) = <span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">ref </span>crypto) = space.crypto {
|
||||
<a href=#354 id=354 data-nosnippet>354</a> (<span class="kw-2">&*</span>crypto.header.local, <span class="kw-2">&*</span>crypto.packet.local)
|
||||
<a href=#355 id=355 data-nosnippet>355</a> } <span class="kw">else if </span><span class="self">self</span>.space == SpaceId::Data {
|
||||
<a href=#356 id=356 data-nosnippet>356</a> <span class="kw">let </span>zero_rtt = conn.zero_rtt_crypto.as_ref().unwrap();
|
||||
<a href=#357 id=357 data-nosnippet>357</a> (<span class="kw-2">&*</span>zero_rtt.header, <span class="kw-2">&*</span>zero_rtt.packet)
|
||||
<a href=#358 id=358 data-nosnippet>358</a> } <span class="kw">else </span>{
|
||||
<a href=#359 id=359 data-nosnippet>359</a> <span class="macro">unreachable!</span>(<span class="string">"tried to send {:?} packet without keys"</span>, <span class="self">self</span>.space);
|
||||
<a href=#360 id=360 data-nosnippet>360</a> };
|
||||
<a href=#361 id=361 data-nosnippet>361</a>
|
||||
<a href=#362 id=362 data-nosnippet>362</a> <span class="macro">debug_assert_eq!</span>(
|
||||
<a href=#363 id=363 data-nosnippet>363</a> packet_crypto.tag_len(),
|
||||
<a href=#364 id=364 data-nosnippet>364</a> <span class="self">self</span>.tag_len,
|
||||
<a href=#365 id=365 data-nosnippet>365</a> <span class="string">"Mismatching crypto tag len"
|
||||
<a href=#366 id=366 data-nosnippet>366</a> </span>);
|
||||
<a href=#367 id=367 data-nosnippet>367</a>
|
||||
<a href=#368 id=368 data-nosnippet>368</a> <span class="self">self</span>.buf.put_bytes(<span class="number">0</span>, packet_crypto.tag_len());
|
||||
<a href=#369 id=369 data-nosnippet>369</a> <span class="kw">let </span>encode_start = <span class="self">self</span>.partial_encode.start;
|
||||
<a href=#370 id=370 data-nosnippet>370</a> <span class="kw">let </span>packet_buf = <span class="kw-2">&mut </span><span class="self">self</span>.buf.as_mut_slice()[encode_start..];
|
||||
<a href=#371 id=371 data-nosnippet>371</a> <span class="comment">// for packet protection, PathId::ZERO and no path are equivalent.
|
||||
<a href=#372 id=372 data-nosnippet>372</a> </span><span class="self">self</span>.partial_encode.finish(
|
||||
<a href=#373 id=373 data-nosnippet>373</a> packet_buf,
|
||||
<a href=#374 id=374 data-nosnippet>374</a> header_crypto,
|
||||
<a href=#375 id=375 data-nosnippet>375</a> <span class="prelude-val">Some</span>((<span class="self">self</span>.exact_number, <span class="self">self</span>.path, packet_crypto)),
|
||||
<a href=#376 id=376 data-nosnippet>376</a> );
|
||||
<a href=#377 id=377 data-nosnippet>377</a>
|
||||
<a href=#378 id=378 data-nosnippet>378</a> <span class="kw">let </span>packet_len = <span class="self">self</span>.buf.len() - encode_start;
|
||||
<a href=#379 id=379 data-nosnippet>379</a> <span class="macro">trace!</span>(size = %packet_len, short_header = %<span class="self">self</span>.short_header, <span class="string">"wrote packet"</span>);
|
||||
<a href=#380 id=380 data-nosnippet>380</a> <span class="self">self</span>.qlog.finalize(packet_len);
|
||||
<a href=#381 id=381 data-nosnippet>381</a> conn.qlog.emit_packet_sent(<span class="self">self</span>.qlog, now);
|
||||
<a href=#382 id=382 data-nosnippet>382</a> (packet_len, pad, <span class="self">self</span>.sent_frames)
|
||||
<a href=#383 id=383 data-nosnippet>383</a> }
|
||||
<a href=#384 id=384 data-nosnippet>384</a>
|
||||
<a href=#385 id=385 data-nosnippet>385</a> <span class="doccomment">/// The number of additional bytes the current packet would take up if it was finished now
|
||||
<a href=#386 id=386 data-nosnippet>386</a> ///
|
||||
<a href=#387 id=387 data-nosnippet>387</a> /// This will include any padding which is required to make the size large enough to be
|
||||
<a href=#388 id=388 data-nosnippet>388</a> /// encrypted correctly.
|
||||
<a href=#389 id=389 data-nosnippet>389</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>predict_packet_end(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<a href=#390 id=390 data-nosnippet>390</a> <span class="self">self</span>.buf.len().max(<span class="self">self</span>.min_size) + <span class="self">self</span>.tag_len - <span class="self">self</span>.buf.len()
|
||||
<a href=#391 id=391 data-nosnippet>391</a> }
|
||||
<a href=#392 id=392 data-nosnippet>392</a>
|
||||
<a href=#393 id=393 data-nosnippet>393</a> <span class="doccomment">/// Returns the remaining space in the packet that can be taken up by QUIC frames
|
||||
<a href=#394 id=394 data-nosnippet>394</a> ///
|
||||
<a href=#395 id=395 data-nosnippet>395</a> /// This leaves space in the datagram for the cryptographic tag that needs to be written
|
||||
<a href=#396 id=396 data-nosnippet>396</a> /// when the packet is finished.
|
||||
<a href=#397 id=397 data-nosnippet>397</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>frame_space_remaining(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<a href=#398 id=398 data-nosnippet>398</a> <span class="kw">let </span>max_offset = <span class="self">self</span>.buf.datagram_max_offset() - <span class="self">self</span>.tag_len;
|
||||
<a href=#399 id=399 data-nosnippet>399</a> max_offset.saturating_sub(<span class="self">self</span>.buf.len())
|
||||
<a href=#400 id=400 data-nosnippet>400</a> }
|
||||
<a href=#401 id=401 data-nosnippet>401</a>
|
||||
<a href=#402 id=402 data-nosnippet>402</a> <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>require_padding(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<a href=#403 id=403 data-nosnippet>403</a> <span class="self">self</span>.sent_frames.requires_padding = <span class="bool-val">true</span>;
|
||||
<a href=#404 id=404 data-nosnippet>404</a> }
|
||||
<a href=#405 id=405 data-nosnippet>405</a>
|
||||
<a href=#406 id=406 data-nosnippet>406</a> <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>retransmits_mut(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="kw-2">&mut </span>Retransmits {
|
||||
<a href=#407 id=407 data-nosnippet>407</a> <span class="self">self</span>.sent_frames.retransmits_mut()
|
||||
<a href=#408 id=408 data-nosnippet>408</a> }
|
||||
<a href=#409 id=409 data-nosnippet>409</a>}
|
||||
<a href=#410 id=410 data-nosnippet>410</a>
|
||||
<a href=#411 id=411 data-nosnippet>411</a><span class="attr">#[derive(Debug, Copy, Clone)]
|
||||
<a href=#412 id=412 data-nosnippet>412</a></span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">enum </span>PadDatagram {
|
||||
<a href=#413 id=413 data-nosnippet>413</a> <span class="doccomment">/// Do not pad the datagram
|
||||
<a href=#414 id=414 data-nosnippet>414</a> </span>No,
|
||||
<a href=#415 id=415 data-nosnippet>415</a> <span class="doccomment">/// To a specific size
|
||||
<a href=#416 id=416 data-nosnippet>416</a> </span>ToSize(u16),
|
||||
<a href=#417 id=417 data-nosnippet>417</a> <span class="doccomment">/// Pad to the current MTU/segment size
|
||||
<a href=#418 id=418 data-nosnippet>418</a> ///
|
||||
<a href=#419 id=419 data-nosnippet>419</a> /// For the first datagram in a transmit the MTU is the same as the
|
||||
<a href=#420 id=420 data-nosnippet>420</a> /// [`TransmitBuf::segment_size`].
|
||||
<a href=#421 id=421 data-nosnippet>421</a> </span>ToSegmentSize,
|
||||
<a href=#422 id=422 data-nosnippet>422</a> <span class="doccomment">/// Pad to [`MIN_INITIAL_SIZE`], the minimal QUIC MTU of 1200 bytes
|
||||
<a href=#423 id=423 data-nosnippet>423</a> </span>ToMinMtu,
|
||||
<a href=#424 id=424 data-nosnippet>424</a>}
|
||||
<a href=#425 id=425 data-nosnippet>425</a>
|
||||
<a href=#426 id=426 data-nosnippet>426</a><span class="kw">impl </span>std::ops::BitOrAssign <span class="kw">for </span>PadDatagram {
|
||||
<a href=#427 id=427 data-nosnippet>427</a> <span class="kw">fn </span>bitor_assign(<span class="kw-2">&mut </span><span class="self">self</span>, rhs: <span class="self">Self</span>) {
|
||||
<a href=#428 id=428 data-nosnippet>428</a> <span class="kw-2">*</span><span class="self">self </span>= <span class="kw-2">*</span><span class="self">self </span>| rhs;
|
||||
<a href=#429 id=429 data-nosnippet>429</a> }
|
||||
<a href=#430 id=430 data-nosnippet>430</a>}
|
||||
<a href=#431 id=431 data-nosnippet>431</a>
|
||||
<a href=#432 id=432 data-nosnippet>432</a><span class="kw">impl </span>std::ops::BitOr <span class="kw">for </span>PadDatagram {
|
||||
<a href=#433 id=433 data-nosnippet>433</a> <span class="kw">type </span>Output = <span class="self">Self</span>;
|
||||
<a href=#434 id=434 data-nosnippet>434</a>
|
||||
<a href=#435 id=435 data-nosnippet>435</a> <span class="kw">fn </span>bitor(<span class="self">self</span>, rhs: <span class="self">Self</span>) -> <span class="self">Self</span>::Output {
|
||||
<a href=#436 id=436 data-nosnippet>436</a> <span class="kw">match </span>(<span class="self">self</span>, rhs) {
|
||||
<a href=#437 id=437 data-nosnippet>437</a> (<span class="self">Self</span>::No, rhs) => rhs,
|
||||
<a href=#438 id=438 data-nosnippet>438</a> (<span class="self">Self</span>::ToSize(size), <span class="self">Self</span>::No) => <span class="self">Self</span>::ToSize(size),
|
||||
<a href=#439 id=439 data-nosnippet>439</a> (<span class="self">Self</span>::ToSize(a), <span class="self">Self</span>::ToSize(b)) => <span class="self">Self</span>::ToSize(a.max(b)),
|
||||
<a href=#440 id=440 data-nosnippet>440</a> (<span class="self">Self</span>::ToSize(<span class="kw">_</span>), <span class="self">Self</span>::ToSegmentSize) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#441 id=441 data-nosnippet>441</a> (<span class="self">Self</span>::ToSize(<span class="kw">_</span>), <span class="self">Self</span>::ToMinMtu) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#442 id=442 data-nosnippet>442</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::No) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#443 id=443 data-nosnippet>443</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToSize(<span class="kw">_</span>)) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#444 id=444 data-nosnippet>444</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToSegmentSize) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#445 id=445 data-nosnippet>445</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToMinMtu) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#446 id=446 data-nosnippet>446</a> (<span class="self">Self</span>::ToMinMtu, <span class="kw">_</span>) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#447 id=447 data-nosnippet>447</a> }
|
||||
<a href=#448 id=448 data-nosnippet>448</a> }
|
||||
<a href=#449 id=449 data-nosnippet>449</a>}</code></pre></div></section></main></body></html>
|
||||
<a href=#332 id=332 data-nosnippet>332</a>
|
||||
<a href=#333 id=333 data-nosnippet>333</a> exact_number
|
||||
<a href=#334 id=334 data-nosnippet>334</a> }
|
||||
<a href=#335 id=335 data-nosnippet>335</a>
|
||||
<a href=#336 id=336 data-nosnippet>336</a> <span class="doccomment">/// Encrypt packet, returning the length of the packet and whether padding was added
|
||||
<a href=#337 id=337 data-nosnippet>337</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>finish(
|
||||
<a href=#338 id=338 data-nosnippet>338</a> <span class="kw-2">mut </span><span class="self">self</span>,
|
||||
<a href=#339 id=339 data-nosnippet>339</a> conn: <span class="kw-2">&mut </span>Connection,
|
||||
<a href=#340 id=340 data-nosnippet>340</a> now: Instant,
|
||||
<a href=#341 id=341 data-nosnippet>341</a> ) -> (usize, bool, SentFrames) {
|
||||
<a href=#342 id=342 data-nosnippet>342</a> <span class="macro">debug_assert!</span>(
|
||||
<a href=#343 id=343 data-nosnippet>343</a> <span class="self">self</span>.buf.len() <= <span class="self">self</span>.buf.datagram_max_offset() - <span class="self">self</span>.tag_len,
|
||||
<a href=#344 id=344 data-nosnippet>344</a> <span class="string">"packet exceeds maximum size"
|
||||
<a href=#345 id=345 data-nosnippet>345</a> </span>);
|
||||
<a href=#346 id=346 data-nosnippet>346</a> <span class="kw">let </span>pad = <span class="self">self</span>.buf.len() < <span class="self">self</span>.min_size;
|
||||
<a href=#347 id=347 data-nosnippet>347</a> <span class="kw">if </span>pad {
|
||||
<a href=#348 id=348 data-nosnippet>348</a> <span class="kw">let </span>padding = <span class="self">self</span>.min_size - <span class="self">self</span>.buf.len();
|
||||
<a href=#349 id=349 data-nosnippet>349</a> <span class="macro">trace!</span>(<span class="string">"PADDING * {}"</span>, padding);
|
||||
<a href=#350 id=350 data-nosnippet>350</a> <span class="self">self</span>.buf.put_bytes(<span class="number">0</span>, padding);
|
||||
<a href=#351 id=351 data-nosnippet>351</a> <span class="self">self</span>.qlog.frame_padding(padding);
|
||||
<a href=#352 id=352 data-nosnippet>352</a> }
|
||||
<a href=#353 id=353 data-nosnippet>353</a>
|
||||
<a href=#354 id=354 data-nosnippet>354</a> <span class="kw">let </span>space = <span class="kw-2">&</span>conn.spaces[<span class="self">self</span>.space];
|
||||
<a href=#355 id=355 data-nosnippet>355</a> <span class="kw">let </span>(header_crypto, packet_crypto) = <span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">ref </span>crypto) = space.crypto {
|
||||
<a href=#356 id=356 data-nosnippet>356</a> (<span class="kw-2">&*</span>crypto.header.local, <span class="kw-2">&*</span>crypto.packet.local)
|
||||
<a href=#357 id=357 data-nosnippet>357</a> } <span class="kw">else if </span><span class="self">self</span>.space == SpaceId::Data {
|
||||
<a href=#358 id=358 data-nosnippet>358</a> <span class="kw">let </span>zero_rtt = conn.zero_rtt_crypto.as_ref().unwrap();
|
||||
<a href=#359 id=359 data-nosnippet>359</a> (<span class="kw-2">&*</span>zero_rtt.header, <span class="kw-2">&*</span>zero_rtt.packet)
|
||||
<a href=#360 id=360 data-nosnippet>360</a> } <span class="kw">else </span>{
|
||||
<a href=#361 id=361 data-nosnippet>361</a> <span class="macro">unreachable!</span>(<span class="string">"tried to send {:?} packet without keys"</span>, <span class="self">self</span>.space);
|
||||
<a href=#362 id=362 data-nosnippet>362</a> };
|
||||
<a href=#363 id=363 data-nosnippet>363</a>
|
||||
<a href=#364 id=364 data-nosnippet>364</a> <span class="macro">debug_assert_eq!</span>(
|
||||
<a href=#365 id=365 data-nosnippet>365</a> packet_crypto.tag_len(),
|
||||
<a href=#366 id=366 data-nosnippet>366</a> <span class="self">self</span>.tag_len,
|
||||
<a href=#367 id=367 data-nosnippet>367</a> <span class="string">"Mismatching crypto tag len"
|
||||
<a href=#368 id=368 data-nosnippet>368</a> </span>);
|
||||
<a href=#369 id=369 data-nosnippet>369</a>
|
||||
<a href=#370 id=370 data-nosnippet>370</a> <span class="self">self</span>.buf.put_bytes(<span class="number">0</span>, packet_crypto.tag_len());
|
||||
<a href=#371 id=371 data-nosnippet>371</a> <span class="kw">let </span>encode_start = <span class="self">self</span>.partial_encode.start;
|
||||
<a href=#372 id=372 data-nosnippet>372</a> <span class="kw">let </span>packet_buf = <span class="kw-2">&mut </span><span class="self">self</span>.buf.as_mut_slice()[encode_start..];
|
||||
<a href=#373 id=373 data-nosnippet>373</a> <span class="comment">// for packet protection, PathId::ZERO and no path are equivalent.
|
||||
<a href=#374 id=374 data-nosnippet>374</a> </span><span class="self">self</span>.partial_encode.finish(
|
||||
<a href=#375 id=375 data-nosnippet>375</a> packet_buf,
|
||||
<a href=#376 id=376 data-nosnippet>376</a> header_crypto,
|
||||
<a href=#377 id=377 data-nosnippet>377</a> <span class="prelude-val">Some</span>((<span class="self">self</span>.exact_number, <span class="self">self</span>.path, packet_crypto)),
|
||||
<a href=#378 id=378 data-nosnippet>378</a> );
|
||||
<a href=#379 id=379 data-nosnippet>379</a>
|
||||
<a href=#380 id=380 data-nosnippet>380</a> <span class="kw">let </span>packet_len = <span class="self">self</span>.buf.len() - encode_start;
|
||||
<a href=#381 id=381 data-nosnippet>381</a> <span class="macro">trace!</span>(size = %packet_len, short_header = %<span class="self">self</span>.short_header, <span class="string">"wrote packet"</span>);
|
||||
<a href=#382 id=382 data-nosnippet>382</a> <span class="self">self</span>.qlog.finalize(packet_len);
|
||||
<a href=#383 id=383 data-nosnippet>383</a> conn.qlog.emit_packet_sent(<span class="self">self</span>.qlog, now);
|
||||
<a href=#384 id=384 data-nosnippet>384</a> (packet_len, pad, <span class="self">self</span>.sent_frames)
|
||||
<a href=#385 id=385 data-nosnippet>385</a> }
|
||||
<a href=#386 id=386 data-nosnippet>386</a>
|
||||
<a href=#387 id=387 data-nosnippet>387</a> <span class="doccomment">/// The number of additional bytes the current packet would take up if it was finished now
|
||||
<a href=#388 id=388 data-nosnippet>388</a> ///
|
||||
<a href=#389 id=389 data-nosnippet>389</a> /// This will include any padding which is required to make the size large enough to be
|
||||
<a href=#390 id=390 data-nosnippet>390</a> /// encrypted correctly.
|
||||
<a href=#391 id=391 data-nosnippet>391</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>predict_packet_end(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<a href=#392 id=392 data-nosnippet>392</a> <span class="self">self</span>.buf.len().max(<span class="self">self</span>.min_size) + <span class="self">self</span>.tag_len - <span class="self">self</span>.buf.len()
|
||||
<a href=#393 id=393 data-nosnippet>393</a> }
|
||||
<a href=#394 id=394 data-nosnippet>394</a>
|
||||
<a href=#395 id=395 data-nosnippet>395</a> <span class="doccomment">/// Returns the remaining space in the packet that can be taken up by QUIC frames
|
||||
<a href=#396 id=396 data-nosnippet>396</a> ///
|
||||
<a href=#397 id=397 data-nosnippet>397</a> /// This leaves space in the datagram for the cryptographic tag that needs to be written
|
||||
<a href=#398 id=398 data-nosnippet>398</a> /// when the packet is finished.
|
||||
<a href=#399 id=399 data-nosnippet>399</a> </span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>frame_space_remaining(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<a href=#400 id=400 data-nosnippet>400</a> <span class="kw">let </span>max_offset = <span class="self">self</span>.buf.datagram_max_offset() - <span class="self">self</span>.tag_len;
|
||||
<a href=#401 id=401 data-nosnippet>401</a> max_offset.saturating_sub(<span class="self">self</span>.buf.len())
|
||||
<a href=#402 id=402 data-nosnippet>402</a> }
|
||||
<a href=#403 id=403 data-nosnippet>403</a>
|
||||
<a href=#404 id=404 data-nosnippet>404</a> <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>require_padding(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<a href=#405 id=405 data-nosnippet>405</a> <span class="self">self</span>.sent_frames.requires_padding = <span class="bool-val">true</span>;
|
||||
<a href=#406 id=406 data-nosnippet>406</a> }
|
||||
<a href=#407 id=407 data-nosnippet>407</a>
|
||||
<a href=#408 id=408 data-nosnippet>408</a> <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>retransmits_mut(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="kw-2">&mut </span>Retransmits {
|
||||
<a href=#409 id=409 data-nosnippet>409</a> <span class="self">self</span>.sent_frames.retransmits_mut()
|
||||
<a href=#410 id=410 data-nosnippet>410</a> }
|
||||
<a href=#411 id=411 data-nosnippet>411</a>}
|
||||
<a href=#412 id=412 data-nosnippet>412</a>
|
||||
<a href=#413 id=413 data-nosnippet>413</a><span class="attr">#[derive(Debug, Copy, Clone)]
|
||||
<a href=#414 id=414 data-nosnippet>414</a></span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">enum </span>PadDatagram {
|
||||
<a href=#415 id=415 data-nosnippet>415</a> <span class="doccomment">/// Do not pad the datagram
|
||||
<a href=#416 id=416 data-nosnippet>416</a> </span>No,
|
||||
<a href=#417 id=417 data-nosnippet>417</a> <span class="doccomment">/// To a specific size
|
||||
<a href=#418 id=418 data-nosnippet>418</a> </span>ToSize(u16),
|
||||
<a href=#419 id=419 data-nosnippet>419</a> <span class="doccomment">/// Pad to the current MTU/segment size
|
||||
<a href=#420 id=420 data-nosnippet>420</a> ///
|
||||
<a href=#421 id=421 data-nosnippet>421</a> /// For the first datagram in a transmit the MTU is the same as the
|
||||
<a href=#422 id=422 data-nosnippet>422</a> /// [`TransmitBuf::segment_size`].
|
||||
<a href=#423 id=423 data-nosnippet>423</a> </span>ToSegmentSize,
|
||||
<a href=#424 id=424 data-nosnippet>424</a> <span class="doccomment">/// Pad to [`MIN_INITIAL_SIZE`], the minimal QUIC MTU of 1200 bytes
|
||||
<a href=#425 id=425 data-nosnippet>425</a> </span>ToMinMtu,
|
||||
<a href=#426 id=426 data-nosnippet>426</a>}
|
||||
<a href=#427 id=427 data-nosnippet>427</a>
|
||||
<a href=#428 id=428 data-nosnippet>428</a><span class="kw">impl </span>std::ops::BitOrAssign <span class="kw">for </span>PadDatagram {
|
||||
<a href=#429 id=429 data-nosnippet>429</a> <span class="kw">fn </span>bitor_assign(<span class="kw-2">&mut </span><span class="self">self</span>, rhs: <span class="self">Self</span>) {
|
||||
<a href=#430 id=430 data-nosnippet>430</a> <span class="kw-2">*</span><span class="self">self </span>= <span class="kw-2">*</span><span class="self">self </span>| rhs;
|
||||
<a href=#431 id=431 data-nosnippet>431</a> }
|
||||
<a href=#432 id=432 data-nosnippet>432</a>}
|
||||
<a href=#433 id=433 data-nosnippet>433</a>
|
||||
<a href=#434 id=434 data-nosnippet>434</a><span class="kw">impl </span>std::ops::BitOr <span class="kw">for </span>PadDatagram {
|
||||
<a href=#435 id=435 data-nosnippet>435</a> <span class="kw">type </span>Output = <span class="self">Self</span>;
|
||||
<a href=#436 id=436 data-nosnippet>436</a>
|
||||
<a href=#437 id=437 data-nosnippet>437</a> <span class="kw">fn </span>bitor(<span class="self">self</span>, rhs: <span class="self">Self</span>) -> <span class="self">Self</span>::Output {
|
||||
<a href=#438 id=438 data-nosnippet>438</a> <span class="kw">match </span>(<span class="self">self</span>, rhs) {
|
||||
<a href=#439 id=439 data-nosnippet>439</a> (<span class="self">Self</span>::No, rhs) => rhs,
|
||||
<a href=#440 id=440 data-nosnippet>440</a> (<span class="self">Self</span>::ToSize(size), <span class="self">Self</span>::No) => <span class="self">Self</span>::ToSize(size),
|
||||
<a href=#441 id=441 data-nosnippet>441</a> (<span class="self">Self</span>::ToSize(a), <span class="self">Self</span>::ToSize(b)) => <span class="self">Self</span>::ToSize(a.max(b)),
|
||||
<a href=#442 id=442 data-nosnippet>442</a> (<span class="self">Self</span>::ToSize(<span class="kw">_</span>), <span class="self">Self</span>::ToSegmentSize) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#443 id=443 data-nosnippet>443</a> (<span class="self">Self</span>::ToSize(<span class="kw">_</span>), <span class="self">Self</span>::ToMinMtu) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#444 id=444 data-nosnippet>444</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::No) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#445 id=445 data-nosnippet>445</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToSize(<span class="kw">_</span>)) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#446 id=446 data-nosnippet>446</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToSegmentSize) => <span class="self">Self</span>::ToSegmentSize,
|
||||
<a href=#447 id=447 data-nosnippet>447</a> (<span class="self">Self</span>::ToSegmentSize, <span class="self">Self</span>::ToMinMtu) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#448 id=448 data-nosnippet>448</a> (<span class="self">Self</span>::ToMinMtu, <span class="kw">_</span>) => <span class="self">Self</span>::ToMinMtu,
|
||||
<a href=#449 id=449 data-nosnippet>449</a> }
|
||||
<a href=#450 id=450 data-nosnippet>450</a> }
|
||||
<a href=#451 id=451 data-nosnippet>451</a>}</code></pre></div></section></main></body></html>
|
||||
Reference in New Issue
Block a user