mentat/net2/trait.TcpStreamExt.html
2018-08-22 17:04:13 +00:00

297 lines
No EOL
64 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="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="../main.css" id="themeStyle">
<script src="../storage.js"></script>
<link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
</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'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></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.set_nodelay">set_nodelay</a><a href="#tymethod.nodelay">nodelay</a><a href="#tymethod.set_recv_buffer_size">set_recv_buffer_size</a><a href="#tymethod.recv_buffer_size">recv_buffer_size</a><a href="#tymethod.set_send_buffer_size">set_send_buffer_size</a><a href="#tymethod.send_buffer_size">send_buffer_size</a><a href="#tymethod.set_keepalive_ms">set_keepalive_ms</a><a href="#tymethod.keepalive_ms">keepalive_ms</a><a href="#tymethod.set_keepalive">set_keepalive</a><a href="#tymethod.keepalive">keepalive</a><a href="#tymethod.set_read_timeout_ms">set_read_timeout_ms</a><a href="#tymethod.set_read_timeout">set_read_timeout</a><a href="#tymethod.read_timeout_ms">read_timeout_ms</a><a href="#tymethod.read_timeout">read_timeout</a><a href="#tymethod.set_write_timeout_ms">set_write_timeout_ms</a><a href="#tymethod.set_write_timeout">set_write_timeout</a><a href="#tymethod.write_timeout_ms">write_timeout_ms</a><a href="#tymethod.write_timeout">write_timeout</a><a href="#tymethod.set_ttl">set_ttl</a><a href="#tymethod.ttl">ttl</a><a href="#tymethod.set_only_v6">set_only_v6</a><a href="#tymethod.only_v6">only_v6</a><a href="#tymethod.connect">connect</a><a href="#tymethod.take_error">take_error</a><a href="#tymethod.set_nonblocking">set_nonblocking</a><a href="#tymethod.set_linger">set_linger</a><a href="#tymethod.linger">linger</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-TcpStreamExt">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">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>net2</a>::<wbr><a class="trait" href=''>TcpStreamExt</a></span><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></h1>
<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 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'><span id='set_nodelay.v' class='invisible'><code>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></span></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'><span id='nodelay.v' class='invisible'><code>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></span></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'><span id='set_recv_buffer_size.v' class='invisible'><code>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></span></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'><span id='recv_buffer_size.v' class='invisible'><code>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></span></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'><span id='set_send_buffer_size.v' class='invisible'><code>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></span></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'><span id='send_buffer_size.v' class='invisible'><code>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></span></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'><span id='set_keepalive_ms.v' class='invisible'><code>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></span></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'><span id='keepalive_ms.v' class='invisible'><code>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></span></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'><span id='set_keepalive.v' class='invisible'><code>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></span></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'><span id='keepalive.v' class='invisible'><code>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></span></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'><span id='set_read_timeout_ms.v' class='invisible'><code>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></span></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'><span id='set_read_timeout.v' class='invisible'><code>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></span></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'><span id='read_timeout_ms.v' class='invisible'><code>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></span></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'><span id='read_timeout.v' class='invisible'><code>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></span></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'><span id='set_write_timeout_ms.v' class='invisible'><code>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></span></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'><span id='set_write_timeout.v' class='invisible'><code>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></span></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'><span id='write_timeout_ms.v' class='invisible'><code>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></span></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'><span id='write_timeout.v' class='invisible'><code>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></span></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'><span id='set_ttl.v' class='invisible'><code>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></span></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'><span id='ttl.v' class='invisible'><code>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></span></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'><span id='set_only_v6.v' class='invisible'><code>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></span></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'><span id='only_v6.v' class='invisible'><code>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></span></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'><span id='connect.v' class='invisible'><code>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></span></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'><span id='take_error.v' class='invisible'><code>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></span></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'><span id='set_nonblocking.v' class='invisible'><code>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></span></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'><span id='set_linger.v' class='invisible'><code>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></span></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'><span id='linger.v' class='invisible'><code>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></span></h3><div class='docblock'><p>reads the linger duration for this socket by getting the SO_LINGER option</p>
</div></div>
<h2 id='foreign-impls' class='small-section-header'>
Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
</h2>
<h3 id='impl-TcpStreamExt' class='impl'><span class='in-band'><code>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' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#671-873' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='method.set_recv_buffer_size' class="method"><span id='set_recv_buffer_size.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#673-676' title='goto source code'>[src]</a></span></h4>
<h4 id='method.recv_buffer_size' class="method"><span id='recv_buffer_size.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#678-680' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_send_buffer_size' class="method"><span id='set_send_buffer_size.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#682-684' title='goto source code'>[src]</a></span></h4>
<h4 id='method.send_buffer_size' class="method"><span id='send_buffer_size.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#686-688' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_nodelay' class="method"><span id='set_nodelay.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#690-693' title='goto source code'>[src]</a></span></h4>
<h4 id='method.nodelay' class="method"><span id='nodelay.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#694-697' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_keepalive' class="method"><span id='set_keepalive.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#699-701' title='goto source code'>[src]</a></span></h4>
<h4 id='method.keepalive' class="method"><span id='keepalive.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#703-705' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_keepalive_ms' class="method"><span id='set_keepalive_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#731-739' title='goto source code'>[src]</a></span></h4>
<h4 id='method.keepalive_ms' class="method"><span id='keepalive_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#742-751' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_read_timeout_ms' class="method"><span id='set_read_timeout_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#801-804' title='goto source code'>[src]</a></span></h4>
<h4 id='method.read_timeout_ms' class="method"><span id='read_timeout_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#806-809' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_write_timeout_ms' class="method"><span id='set_write_timeout_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#811-814' title='goto source code'>[src]</a></span></h4>
<h4 id='method.write_timeout_ms' class="method"><span id='write_timeout_ms.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#816-819' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_read_timeout' class="method"><span id='set_read_timeout.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#821-823' title='goto source code'>[src]</a></span></h4>
<h4 id='method.read_timeout' class="method"><span id='read_timeout.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#825-827' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_write_timeout' class="method"><span id='set_write_timeout.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#829-831' title='goto source code'>[src]</a></span></h4>
<h4 id='method.write_timeout' class="method"><span id='write_timeout.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#833-835' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_ttl' class="method"><span id='set_ttl.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#837-839' title='goto source code'>[src]</a></span></h4>
<h4 id='method.ttl' class="method"><span id='ttl.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#841-844' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_only_v6' class="method"><span id='set_only_v6.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#846-848' title='goto source code'>[src]</a></span></h4>
<h4 id='method.only_v6' class="method"><span id='only_v6.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#850-852' title='goto source code'>[src]</a></span></h4>
<h4 id='method.connect' class="method"><span id='connect.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#854-856' title='goto source code'>[src]</a></span></h4>
<h4 id='method.take_error' class="method"><span id='take_error.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#858-860' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_nonblocking' class="method"><span id='set_nonblocking.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#862-864' title='goto source code'>[src]</a></span></h4>
<h4 id='method.set_linger' class="method"><span id='set_linger.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#866-868' title='goto source code'>[src]</a></span></h4>
<h4 id='method.linger' class="method"><span id='linger.v-1' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/net2/ext.rs.html#870-872' title='goto source code'>[src]</a></span></h4>
</div></span>
<h2 id='implementors' class='small-section-header'>
Implementors<a href='#implementors' class='anchor'></a>
</h2>
<ul class='item-list' id='implementors-list'>
</ul><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>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "net2";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>