Files
GopherGate/target/doc/tokio/io/trait.AsyncSeek.html
2026-02-26 12:00:21 -05:00

81 lines
26 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Seek bytes asynchronously."><title>AsyncSeek in tokio::io - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">AsyncSeek</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.49.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Async<wbr>Seek</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.poll_complete" title="poll_complete">poll_complete</a></li><li><a href="#tymethod.start_seek" title="start_seek">start_seek</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-AsyncSeek-for-%26mut+T" title="&#38;mut T">&#38;mut T</a></li><li><a href="#impl-AsyncSeek-for-Box%3CT%3E" title="Box&#60;T&#62;">Box&#60;T&#62;</a></li><li><a href="#impl-AsyncSeek-for-Cursor%3CT%3E" title="Cursor&#60;T&#62;">Cursor&#60;T&#62;</a></li><li><a href="#impl-AsyncSeek-for-Pin%3CP%3E" title="Pin&#60;P&#62;">Pin&#60;P&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">io</a></div><h1>Trait <span class="trait">Async<wbr>Seek</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/io/async_seek.rs.html#18-53">Source</a> </span></div><pre class="rust item-decl"><code>pub trait AsyncSeek {
// Required methods
fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, position: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Seek bytes asynchronously.</p>
<p>This trait is analogous to the <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Seek.html" title="trait std::io::Seek"><code>std::io::Seek</code></a> trait, but integrates
with the asynchronous task system. In particular, the <code>start_seek</code>
method, unlike <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Seek.html#tymethod.seek" title="method std::io::Seek::seek"><code>Seek::seek</code></a>, will not block the calling thread.</p>
<p>Utilities for working with <code>AsyncSeek</code> values are provided by
<a href="trait.AsyncSeekExt.html" title="trait tokio::io::AsyncSeekExt"><code>AsyncSeekExt</code></a>.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.start_seek" class="method"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#33">Source</a><h4 class="code-header">fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, position: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Attempts to seek to an offset, in bytes, in a stream.</p>
<p>A seek beyond the end of a stream is allowed, but behavior is defined
by the implementation.</p>
<p>If this function returns successfully, then the job has been submitted.
To find out when it completes, call <code>poll_complete</code>.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>This function can return <a href="https://doc.rust-lang.org/1.93.1/std/io/error/enum.ErrorKind.html#variant.Other" title="variant std::io::error::ErrorKind::Other"><code>io::ErrorKind::Other</code></a> in case there is
another seek in progress. To avoid this, it is advisable that any call
to <code>start_seek</code> is preceded by a call to <code>poll_complete</code> to ensure all
pending seeks have completed.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.poll_complete" class="method"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#52">Source</a><h4 class="code-header">fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Waits for a seek operation to complete.</p>
<p>If the seek operation completed successfully, this method returns the
new position from the start of the stream. That position can be used
later with <a href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html#variant.Start" title="variant std::io::SeekFrom::Start"><code>SeekFrom::Start</code></a>.</p>
<p>The position returned by calling this method can only be relied on right
after <code>start_seek</code>. If you have changed the position by e.g. reading or
writing since calling <code>start_seek</code>, then it is unspecified whether the
returned position takes that position change into account. Similarly, if
<code>start_seek</code> has never been called, then it is unspecified whether
<code>poll_complete</code> returns the actual position or some other placeholder
value (such as 0).</p>
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
<p>Seeking to a negative offset is considered an error.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-AsyncSeek-for-Pin%3CP%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#75-87">Source</a><a href="#impl-AsyncSeek-for-Pin%3CP%3E" class="anchor">§</a><h3 class="code-header">impl&lt;P&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;P&gt;<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a>,
P::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a>: <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a>,</div></h3></section></summary><div class="impl-items"><section id="method.start_seek" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#80-82">Source</a><a href="#method.start_seek" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section><section id="method.poll_complete" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#84-86">Source</a><a href="#method.poll_complete" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncSeek-for-Cursor%3CT%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#89-96">Source</a><a href="#impl-AsyncSeek-for-Cursor%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.start_seek-1" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#90-92">Source</a><a href="#method.start_seek-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section><section id="method.poll_complete-1" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#93-95">Source</a><a href="#method.poll_complete-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncSeek-for-%26mut+T" class="impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#71-73">Source</a><a href="#impl-AsyncSeek-for-%26mut+T" class="anchor">§</a><h3 class="code-header">impl&lt;T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a></h3></section></summary><div class="impl-items"><section id="method.start_seek-2" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#72">Source</a><a href="#method.start_seek-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section><section id="method.poll_complete-2" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#72">Source</a><a href="#method.poll_complete-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncSeek-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#67-69">Source</a><a href="#impl-AsyncSeek-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.start_seek-3" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#68">Source</a><a href="#method.start_seek-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.start_seek" class="fn">start_seek</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section><section id="method.poll_complete-3" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_seek.rs.html#68">Source</a><a href="#method.poll_complete-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_complete" class="fn">poll_complete</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>&gt;&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsyncSeek-for-File" class="impl"><a class="src rightside" href="../../src/tokio/fs/file.rs.html#664-726">Source</a><a href="#impl-AsyncSeek-for-File" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="../fs/struct.File.html" title="struct tokio::fs::File">File</a></h3></section><section id="impl-AsyncSeek-for-Empty" class="impl"><a class="src rightside" href="../../src/tokio/io/util/empty.rs.html#136-148">Source</a><a href="#impl-AsyncSeek-for-Empty" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="struct.Empty.html" title="struct tokio::io::Empty">Empty</a></h3></section><section id="impl-AsyncSeek-for-BufReader%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_reader.rs.html#176-259">Source</a><a href="#impl-AsyncSeek-for-BufReader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="struct.BufReader.html" title="struct tokio::io::BufReader">BufReader</a>&lt;R&gt;</h3><div class="docblock"><p>Seeks to an offset, in bytes, in the underlying reader.</p>
</div></section><div class="docblock"><p>The position used for seeking with <code>SeekFrom::Current(_)</code> is the
position the underlying reader would be at if the <code>BufReader</code> had no
internal buffer.</p>
<p>Seeking always discards the internal buffer, even if the seek position
would otherwise fall within it. This guarantees that calling
<code>.into_inner()</code> immediately after a seek yields the underlying reader
at the same position.</p>
<p>See <a href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek"><code>AsyncSeek</code></a> for more details.</p>
<p>Note: In the edge case where youre seeking with <code>SeekFrom::Current(n)</code>
where <code>n</code> minus the internal buffer length overflows an <code>i64</code>, two
seeks will be performed instead of one. If the second seek returns
<code>Err</code>, the underlying reader will be left at the same position it would
have if you called <code>seek</code> with <code>SeekFrom::Current(0)</code>.</p>
</div><section id="impl-AsyncSeek-for-BufStream%3CRW%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_stream.rs.html#179-187">Source</a><a href="#impl-AsyncSeek-for-BufStream%3CRW%3E" class="anchor">§</a><h3 class="code-header">impl&lt;RW: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="struct.BufStream.html" title="struct tokio::io::BufStream">BufStream</a>&lt;RW&gt;</h3><div class="docblock"><p>Seek to an offset, in bytes, in the underlying stream.</p>
</div></section><div class="docblock"><p>The position used for seeking with <code>SeekFrom::Current(_)</code> is the
position the underlying stream would be at if the <code>BufStream</code> had no
internal buffer.</p>
<p>Seeking always discards the internal buffer, even if the seek position
would otherwise fall within it. This guarantees that calling
<code>.into_inner()</code> immediately after a seek yields the underlying reader
at the same position.</p>
<p>See <a href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek"><code>AsyncSeek</code></a> for more details.</p>
<p>Note: In the edge case where youre seeking with <code>SeekFrom::Current(n)</code>
where <code>n</code> minus the internal buffer length overflows an <code>i64</code>, two
seeks will be performed instead of one. If the second seek returns
<code>Err</code>, the underlying reader will be left at the same position it would
have if you called <code>seek</code> with <code>SeekFrom::Current(0)</code>.</p>
</div><section id="impl-AsyncSeek-for-BufWriter%3CW%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_writer.rs.html#226-267">Source</a><a href="#impl-AsyncSeek-for-BufWriter%3CW%3E" class="anchor">§</a><h3 class="code-header">impl&lt;W: <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a>&gt; <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> for <a class="struct" href="struct.BufWriter.html" title="struct tokio::io::BufWriter">BufWriter</a>&lt;W&gt;</h3><div class="docblock"><p>Seek to the offset, in bytes, in the underlying writer.</p>
</div></section><div class="docblock"><p>Seeking always writes out the internal buffer before seeking.</p>
</div></div><script src="../../trait.impl/tokio/io/async_seek/trait.AsyncSeek.js" data-ignore-extern-crates="alloc,core,std" async></script></section></div></main></body></html>