You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Trac3r-rust/doc/net2/trait.TcpStreamExt.html

132 lines
60 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TcpStreamExt` trait in crate `net2`."><meta name="keywords" content="rust, rustlang, rust-lang, TcpStreamExt"><title>net2::TcpStreamExt - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../net2/index.html'><div class='logo-container'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo'></div></a><p class='location'>Trait TcpStreamExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.connect">connect</a><a href="#tymethod.keepalive">keepalive</a><a href="#tymethod.keepalive_ms">keepalive_ms</a><a href="#tymethod.linger">linger</a><a href="#tymethod.nodelay">nodelay</a><a href="#tymethod.only_v6">only_v6</a><a href="#tymethod.read_timeout">read_timeout</a><a href="#tymethod.read_timeout_ms">read_timeout_ms</a><a href="#tymethod.recv_buffer_size">recv_buffer_size</a><a href="#tymethod.send_buffer_size">send_buffer_size</a><a href="#tymethod.set_keepalive">set_keepalive</a><a href="#tymethod.set_keepalive_ms">set_keepalive_ms</a><a href="#tymethod.set_linger">set_linger</a><a href="#tymethod.set_nodelay">set_nodelay</a><a href="#tymethod.set_nonblocking">set_nonblocking</a><a href="#tymethod.set_only_v6">set_only_v6</a><a href="#tymethod.set_read_timeout">set_read_timeout</a><a href="#tymethod.set_read_timeout_ms">set_read_timeout_ms</a><a href="#tymethod.set_recv_buffer_size">set_recv_buffer_size</a><a href="#tymethod.set_send_buffer_size">set_send_buffer_size</a><a href="#tymethod.set_ttl">set_ttl</a><a href="#tymethod.set_write_timeout">set_write_timeout</a><a href="#tymethod.set_write_timeout_ms">set_write_timeout_ms</a><a href="#tymethod.take_error">take_error</a><a href="#tymethod.ttl">ttl</a><a href="#tymethod.write_timeout">write_timeout</a><a href="#tymethod.write_timeout_ms">write_timeout_ms</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-TcpStreamExt-for-TcpStream">TcpStream</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>net2</a></p><script>window.sidebarCurrent = {name: 'TcpStreamExt', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/net2/ext.rs.html#91-295' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>net2</a>::<wbr><a class="trait" href=''>TcpStreamExt</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait TcpStreamExt {
fn <a href='#tymethod.set_nodelay' class='fnname'>set_nodelay</a>(&amp;self, nodelay: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.nodelay' class='fnname'>nodelay</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_keepalive_ms' class='fnname'>set_keepalive_ms</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.keepalive_ms' class='fnname'>keepalive_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_keepalive' class='fnname'>set_keepalive</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.keepalive' class='fnname'>keepalive</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_read_timeout_ms' class='fnname'>set_read_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.read_timeout_ms' class='fnname'>read_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.read_timeout' class='fnname'>read_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_write_timeout_ms' class='fnname'>set_write_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.write_timeout_ms' class='fnname'>write_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.write_timeout' class='fnname'>write_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_ttl' class='fnname'>set_ttl</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.ttl' class='fnname'>ttl</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_only_v6' class='fnname'>set_only_v6</a>(&amp;self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.only_v6' class='fnname'>only_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.connect' class='fnname'>connect</a>&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(&amp;self, addr: T) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.take_error' class='fnname'>take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_nonblocking' class='fnname'>set_nonblocking</a>(&amp;self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_linger' class='fnname'>set_linger</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.linger' class='fnname'>linger</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
}</pre></div><div class='docblock'><p>Extension methods for the standard <a href="https://doc.rust-lang.org/std/net/struct.TcpStream.html"><code>TcpStream</code> type</a> in <code>std::net</code>.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.set_nodelay' class='method'><code id='set_nodelay.v'>fn <a href='#tymethod.set_nodelay' class='fnname'>set_nodelay</a>(&amp;self, nodelay: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>TCP_NODELAY</code> option on this socket.</p>
<p>If set, this option disables the Nagle algorithm. This means that
segments are always sent as soon as possible, even if there is only a
small amount of data. When not set, data is buffered until there is a
sufficient amount to send out, thereby avoiding the frequent sending of
small packets.</p>
</div><h3 id='tymethod.nodelay' class='method'><code id='nodelay.v'>fn <a href='#tymethod.nodelay' class='fnname'>nodelay</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>TCP_NODELAY</code> option on this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_nodelay"><code>set_nodelay</code></a>.</p>
</div><h3 id='tymethod.set_recv_buffer_size' class='method'><code id='set_recv_buffer_size.v'>fn <a href='#tymethod.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>SO_RCVBUF</code> option on this socket.</p>
<p>Changes the size of the operating system's receive buffer associated with the socket.</p>
</div><h3 id='tymethod.recv_buffer_size' class='method'><code id='recv_buffer_size.v'>fn <a href='#tymethod.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVBUF</code> option on this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_recv_buffer_size"><code>set_recv_buffer_size</code></a>.</p>
</div><h3 id='tymethod.set_send_buffer_size' class='method'><code id='set_send_buffer_size.v'>fn <a href='#tymethod.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>SO_SNDBUF</code> option on this socket.</p>
<p>Changes the size of the operating system's send buffer associated with the socket.</p>
</div><h3 id='tymethod.send_buffer_size' class='method'><code id='send_buffer_size.v'>fn <a href='#tymethod.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDBUF</code> option on this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_send_buffer"><code>set_send_buffer</code></a>.</p>
</div><h3 id='tymethod.set_keepalive_ms' class='method'><code id='set_keepalive_ms.v'>fn <a href='#tymethod.set_keepalive_ms' class='fnname'>set_keepalive_ms</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets whether keepalive messages are enabled to be sent on this socket.</p>
<p>On Unix, this option will set the <code>SO_KEEPALIVE</code> as well as the
<code>TCP_KEEPALIVE</code> or <code>TCP_KEEPIDLE</code> option (depending on your platform).
On Windows, this will set the <code>SIO_KEEPALIVE_VALS</code> option.</p>
<p>If <code>None</code> is specified then keepalive messages are disabled, otherwise
the number of milliseconds specified will be the time to remain idle
before sending a TCP keepalive probe.</p>
<p>Some platforms specify this value in seconds, so sub-second millisecond
specifications may be omitted.</p>
</div><h3 id='tymethod.keepalive_ms' class='method'><code id='keepalive_ms.v'>fn <a href='#tymethod.keepalive_ms' class='fnname'>keepalive_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code></h3><div class='docblock'><p>Returns whether keepalive messages are enabled on this socket, and if so
the amount of milliseconds between them.</p>
<p>For more information about this option, see <a href="#tymethod.set_keepalive_ms"><code>set_keepalive_ms</code></a>.</p>
</div><h3 id='tymethod.set_keepalive' class='method'><code id='set_keepalive.v'>fn <a href='#tymethod.set_keepalive' class='fnname'>set_keepalive</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets whether keepalive messages are enabled to be sent on this socket.</p>
<p>On Unix, this option will set the <code>SO_KEEPALIVE</code> as well as the
<code>TCP_KEEPALIVE</code> or <code>TCP_KEEPIDLE</code> option (depending on your platform).
On Windows, this will set the <code>SIO_KEEPALIVE_VALS</code> option.</p>
<p>If <code>None</code> is specified then keepalive messages are disabled, otherwise
the duration specified will be the time to remain idle before sending a
TCP keepalive probe.</p>
<p>Some platforms specify this value in seconds, so sub-second
specifications may be omitted.</p>
</div><h3 id='tymethod.keepalive' class='method'><code id='keepalive.v'>fn <a href='#tymethod.keepalive' class='fnname'>keepalive</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>Returns whether keepalive messages are enabled on this socket, and if so
the duration of time between them.</p>
<p>For more information about this option, see <a href="#tymethod.set_keepalive"><code>set_keepalive</code></a>.</p>
</div><h3 id='tymethod.set_read_timeout_ms' class='method'><code id='set_read_timeout_ms.v'>fn <a href='#tymethod.set_read_timeout_ms' class='fnname'>set_read_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout, in milliseconds, of how long calls to
this socket's <code>read</code> function will wait before returning a timeout. A
value of <code>None</code> means that no read timeout should be specified and
otherwise <code>Some</code> indicates the number of milliseconds for the timeout.</p>
</div><h3 id='tymethod.set_read_timeout' class='method'><code id='set_read_timeout.v'>fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout of how long calls to this socket's
<code>read</code> function will wait before returning a timeout. A value of <code>None</code>
means that no read timeout should be specified and otherwise <code>Some</code>
indicates the number of duration of the timeout.</p>
</div><h3 id='tymethod.read_timeout_ms' class='method'><code id='read_timeout_ms.v'>fn <a href='#tymethod.read_timeout_ms' class='fnname'>read_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_read_timeout_ms"><code>set_read_timeout_ms</code></a>.</p>
</div><h3 id='tymethod.read_timeout' class='method'><code id='read_timeout.v'>fn <a href='#tymethod.read_timeout' class='fnname'>read_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_read_timeout"><code>set_read_timeout</code></a>.</p>
</div><h3 id='tymethod.set_write_timeout_ms' class='method'><code id='set_write_timeout_ms.v'>fn <a href='#tymethod.set_write_timeout_ms' class='fnname'>set_write_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout, in milliseconds, of how long calls to
this socket's <code>write</code> function will wait before returning a timeout. A
value of <code>None</code> means that no read timeout should be specified and
otherwise <code>Some</code> indicates the number of milliseconds for the timeout.</p>
</div><h3 id='tymethod.set_write_timeout' class='method'><code id='set_write_timeout.v'>fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout of how long calls to this socket's
<code>write</code> function will wait before returning a timeout. A value of <code>None</code>
means that no read timeout should be specified and otherwise <code>Some</code>
indicates the duration of the timeout.</p>
</div><h3 id='tymethod.write_timeout_ms' class='method'><code id='write_timeout_ms.v'>fn <a href='#tymethod.write_timeout_ms' class='fnname'>write_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_write_timeout_ms"><code>set_write_timeout_ms</code></a>.</p>
</div><h3 id='tymethod.write_timeout' class='method'><code id='write_timeout.v'>fn <a href='#tymethod.write_timeout' class='fnname'>write_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_write_timeout"><code>set_write_timeout</code></a>.</p>
</div><h3 id='tymethod.set_ttl' class='method'><code id='set_ttl.v'>fn <a href='#tymethod.set_ttl' class='fnname'>set_ttl</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value for the <code>IP_TTL</code> option on this socket.</p>
<p>This value sets the time-to-live field that is used in every packet sent
from this socket.</p>
</div><h3 id='tymethod.ttl' class='method'><code id='ttl.v'>fn <a href='#tymethod.ttl' class='fnname'>ttl</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IP_TTL</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_ttl"><code>set_ttl</code></a>.</p>
</div><h3 id='tymethod.set_only_v6' class='method'><code id='set_only_v6.v'>fn <a href='#tymethod.set_only_v6' class='fnname'>set_only_v6</a>(&amp;self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value for the <code>IPV6_V6ONLY</code> option on this socket.</p>
<p>If this is set to <code>true</code> then the socket is restricted to sending and
receiving IPv6 packets only. In this case two IPv4 and IPv6 applications
can bind the same port at the same time.</p>
<p>If this is set to <code>false</code> then the socket can be used to send and
receive packets from an IPv4-mapped IPv6 address.</p>
</div><h3 id='tymethod.only_v6' class='method'><code id='only_v6.v'>fn <a href='#tymethod.only_v6' class='fnname'>only_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IPV6_V6ONLY</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_only_v6"><code>set_only_v6</code></a>.</p>
</div><h3 id='tymethod.connect' class='method'><code id='connect.v'>fn <a href='#tymethod.connect' class='fnname'>connect</a>&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(&amp;self, addr: T) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Executes a <code>connect</code> operation on this socket, establishing a connection
to the host specified by <code>addr</code>.</p>
<p>Note that this normally does not need to be called on a <code>TcpStream</code>,
it's typically automatically done as part of a normal
<code>TcpStream::connect</code> function call or <code>TcpBuilder::connect</code> method call.</p>
<p>This should only be necessary if an unconnected socket was extracted
from a <code>TcpBuilder</code> and then needs to be connected.</p>
</div><h3 id='tymethod.take_error' class='method'><code id='take_error.v'>fn <a href='#tymethod.take_error' class='fnname'>take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</code></h3><div class='docblock'><p>Get the value of the <code>SO_ERROR</code> option on this socket.</p>
<p>This will retrieve the stored error in the underlying socket, clearing
the field in the process. This can be useful for checking errors between
calls.</p>
</div><h3 id='tymethod.set_nonblocking' class='method'><code id='set_nonblocking.v'>fn <a href='#tymethod.set_nonblocking' class='fnname'>set_nonblocking</a>(&amp;self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Moves this TCP stream into or out of nonblocking mode.</p>
<p>On Unix this corresponds to calling fcntl, and on Windows this
corresponds to calling ioctlsocket.</p>
</div><h3 id='tymethod.set_linger' class='method'><code id='set_linger.v'>fn <a href='#tymethod.set_linger' class='fnname'>set_linger</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the linger duration of this socket by setting the SO_LINGER option</p>
</div><h3 id='tymethod.linger' class='method'><code id='linger.v'>fn <a href='#tymethod.linger' class='fnname'>linger</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>reads the linger duration for this socket by getting the SO_LINGER option</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-TcpStreamExt-for-TcpStream' class='impl'><code class='in-band'>impl <a class="trait" href="../net2/trait.TcpStreamExt.html" title="trait net2::TcpStreamExt">TcpStreamExt</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpStream.html" title="struct std::net::tcp::TcpStream">TcpStream</a></code><a href='#impl-TcpStreamExt-for-TcpStream' class='anchor'></a><a class='srclink' href='../src/net2/ext.rs.html#671-873' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_recv_buffer_size' class="method hidden"><code id='set_recv_buffer_size.v-1'>fn <a href='#method.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#673-676' title='goto source code'>[src]</a></h4><h4 id='method.recv_buffer_size' class="method hidden"><code id='recv_buffer_size.v-1'>fn <a href='#method.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#678-680' title='goto source code'>[src]</a></h4><h4 id='method.set_send_buffer_size' class="method hidden"><code id='set_send_buffer_size.v-1'>fn <a href='#method.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#682-684' title='goto source code'>[src]</a></h4><h4 id='method.send_buffer_size' class="method hidden"><code id='send_buffer_size.v-1'>fn <a href='#method.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#686-688' title='goto source code'>[src]</a></h4><h4 id='method.set_nodelay' class="method hidden"><code id='set_nodelay.v-1'>fn <a href='#method.set_nodelay' class='fnname'>set_nodelay</a>(&amp;self, nodelay: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#690-693' title='goto source code'>[src]</a></h4><h4 id='method.nodelay' class="method hidden"><code id='nodelay.v-1'>fn <a href='#method.nodelay' class='fnname'>nodelay</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#694-697' title='goto source code'>[src]</a></h4><h4 id='method.set_keepalive' class="method hidden"><code id='set_keepalive.v-1'>fn <a href='#method.set_keepalive' class='fnname'>set_keepalive</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#699-701' title='goto source code'>[src]</a></h4><h4 id='method.keepalive' class="method hidden"><code id='keepalive.v-1'>fn <a href='#method.keepalive' class='fnname'>keepalive</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#703-705' title='goto source code'>[src]</a></h4><h4 id='method.set_keepalive_ms' class="method hidden"><code id='set_keepalive_ms.v-1'>fn <a href='#method.set_keepalive_ms' class='fnname'>set_keepalive_ms</a>(&amp;self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#731-739' title='goto source code'>[src]</a></h4><h4 id='method.keepalive_ms' class="method hidden"><code id='keepalive_ms.v-1'>fn <a href='#method.keepalive_ms' class='fnname'>keepalive_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#742-751' title='goto source code'>[src]</a></h4><h4 id='method.set_read_timeout_ms' class="method hidden"><code id='set_read_timeout_ms.v-1'>fn <a href='#method.set_read_timeout_ms' class='fnname'>set_read_timeout_ms</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#801-804' title='goto source code'>[src]</a></h4><h4 id='method.read_timeout_ms' class="method hidden"><code id='read_timeout_ms.v-1'>fn <a href='#method.read_timeout_ms' class='fnname'>read_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#806-809' title='goto source code'>[src]</a></h4><h4 id='method.set_write_timeout_ms' class="method hidden"><code id='set_write_timeout_ms.v-1'>fn <a href='#method.set_write_timeout_ms' class='fnname'>set_write_timeout_ms</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#811-814' title='goto source code'>[src]</a></h4><h4 id='method.write_timeout_ms' class="method hidden"><code id='write_timeout_ms.v-1'>fn <a href='#method.write_timeout_ms' class='fnname'>write_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#816-819' title='goto source code'>[src]</a></h4><h4 id='method.set_read_timeout' class="method hidden"><code id='set_read_timeout.v-1'>fn <a href='#method.set_read_timeout' class='fnname'>set_read_timeout</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#821-823' title='goto source code'>[src]</a></h4><h4 id='method.read_timeout' class="method hidden"><code id='read_timeout.v-1'>fn <a href='#method.read_timeout' class='fnname'>read_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#825-827' title='goto source code'>[src]</a></h4><h4 id='method.set_write_timeout' class="method hidden"><code id='set_write_timeout.v-1'>fn <a href='#method.set_write_timeout' class='fnname'>set_write_timeout</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#829-831' title='goto source code'>[src]</a></h4><h4 id='method.write_timeout' class="method hidden"><code id='write_timeout.v-1'>fn <a href='#method.write_timeout' class='fnname'>write_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#833-835' title='goto source code'>[src]</a></h4><h4 id='method.set_ttl' class="method hidden"><code id='set_ttl.v-1'>fn <a href='#method.set_ttl' class='fnname'>set_ttl</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#837-839' title='goto source code'>[src]</a></h4><h4 id='method.ttl' class="method hidden"><code id='ttl.v-1'>fn <a href='#method.ttl' class='fnname'>ttl</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#841-844' title='goto source code'>[src]</a></h4><h4 id='method.set_only_v6' class="method hidden"><code id='set_only_v6.v-1'>fn <a href='#method.set_only_v6' class='fnname'>set_only_v6</a>(&amp;self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#846-848' title='goto source code'>[src]</a></h4><h4 id='method.only_v6' class="method hidden"><code id='only_v6.v-1'>fn <a href='#method.only_v6' class='fnname'>only_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#850-852' title='goto source code'>[src]</a></h4><h4 id='method.connect' class="method hidden"><code id='connect.v-1'>fn <a href='#method.connect' class='fnname'>connect</a>&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(&amp;self, addr: T) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#854-856' title='goto source code'>[src]</a></h4><h4 id='method.take_error' class="method hidden"><code id='take_error.v-1'>fn <a href='#method.take_error' class='fnname'>take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#858-860' title='goto source code'>[src]</a></h4><h4 id='method.set_nonblocking' class="method hidden"><code id='set_nonblocking.v-1'>fn <a href='#method.set_nonblocking' class='fnname'>set_nonblocking</a>(&amp;self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#862-864' title='goto source code'>[src]</a></h4><h4 id='method.set_linger' class="method hidden"><code id='set_linger.v-1'>fn <a href='#method.set_linger' class='fnname'>set_linger</a>(&amp;self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#866-868' title='goto source code'>[src]</a></h4><h4 id='method.linger' class="method hidden"><code id='linger.v-1'>fn <a href='#method.linger' class='fnname'>linger</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#870-872' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/net2/trait.TcpStreamExt.js">
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "net2";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>