354 lines
149 KiB
HTML
354 lines
149 KiB
HTML
<!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 `Socket` struct in crate `socket2`."><meta name="keywords" content="rust, rustlang, rust-lang, Socket"><title>socket2::Socket - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">☰</div><a href='../socket2/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct Socket</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.accept">accept</a><a href="#method.bind">bind</a><a href="#method.bind_device">bind_device</a><a href="#method.broadcast">broadcast</a><a href="#method.connect">connect</a><a href="#method.connect_timeout">connect_timeout</a><a href="#method.device">device</a><a href="#method.into_tcp_listener">into_tcp_listener</a><a href="#method.into_tcp_stream">into_tcp_stream</a><a href="#method.into_udp_socket">into_udp_socket</a><a href="#method.join_multicast_v4">join_multicast_v4</a><a href="#method.join_multicast_v6">join_multicast_v6</a><a href="#method.keepalive">keepalive</a><a href="#method.leave_multicast_v4">leave_multicast_v4</a><a href="#method.leave_multicast_v6">leave_multicast_v6</a><a href="#method.linger">linger</a><a href="#method.listen">listen</a><a href="#method.local_addr">local_addr</a><a href="#method.mark">mark</a><a href="#method.mss">mss</a><a href="#method.multicast_hops_v6">multicast_hops_v6</a><a href="#method.multicast_if_v4">multicast_if_v4</a><a href="#method.multicast_if_v6">multicast_if_v6</a><a href="#method.multicast_loop_v4">multicast_loop_v4</a><a href="#method.multicast_loop_v6">multicast_loop_v6</a><a href="#method.multicast_ttl_v4">multicast_ttl_v4</a><a href="#method.new">new</a><a href="#method.nodelay">nodelay</a><a href="#method.only_v6">only_v6</a><a href="#method.out_of_band_inline">out_of_band_inline</a><a href="#method.peek">peek</a><a href="#method.peek_from">peek_from</a><a href="#method.peer_addr">peer_addr</a><a href="#method.read_timeout">read_timeout</a><a href="#method.recv">recv</a><a href="#method.recv_buffer_size">recv_buffer_size</a><a href="#method.recv_from">recv_from</a><a href="#method.recv_from_with_flags">recv_from_with_flags</a><a href="#method.recv_out_of_band">recv_out_of_band</a><a href="#method.recv_with_flags">recv_with_flags</a><a href="#method.reuse_address">reuse_address</a><a href="#method.send">send</a><a href="#method.send_buffer_size">send_buffer_size</a><a href="#method.send_out_of_band">send_out_of_band</a><a href="#method.send_to">send_to</a><a href="#method.send_to_with_flags">send_to_with_flags</a><a href="#method.send_with_flags">send_with_flags</a><a href="#method.set_broadcast">set_broadcast</a><a href="#method.set_keepalive">set_keepalive</a><a href="#method.set_linger">set_linger</a><a href="#method.set_mark">set_mark</a><a href="#method.set_mss">set_mss</a><a href="#method.set_multicast_hops_v6">set_multicast_hops_v6</a><a href="#method.set_multicast_if_v4">set_multicast_if_v4</a><a href="#method.set_multicast_if_v6">set_multicast_if_v6</a><a href="#method.set_multicast_loop_v4">set_multicast_loop_v4</a><a href="#method.set_multicast_loop_v6">set_multicast_loop_v6</a><a href="#method.set_multicast_ttl_v4">set_multicast_ttl_v4</a><a href="#method.set_nodelay">set_nodelay</a><a href="#method.set_nonblocking">set_nonblocking</a><a href="#method.set_only_v6">set_only_v6</a><a href="#method.set_out_of_band_inline">set_out_of_band_inline</a><a href="#method.set_read_timeout">set_read_timeout</a><a href="#method.set_recv_buffer_size">set_recv_buffer_size</a><a href="#method.set_reuse_address">set_reuse_address</a><a href="#method.set_send_buffer_size">set_send_buffer_size</a><a href="#method.set_ttl">set_ttl</a><a href="#method.set_unicast_hops_v6">set_unicast_hops_v6</a><a href="#method.set_write_timeout">set_write_timeout</a><a href="#method.shutdown">shutdown</a><a href="#method.take_error">take_error</a><a href="#method.try_clone">try_clone</a><a href="#method.ttl">ttl</a><a href="#method.unicast_hops_v6">unicast_hops_v6</a><a href="#method.write_timeout">write_timeout</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsRawFd">AsRawFd</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CSocket%3E">From<Socket></a><a href="#impl-From%3CTcpListener%3E">From<TcpListener></a><a href="#impl-From%3CTcpStream%3E">From<TcpStream></a><a href="#impl-From%3CUdpSocket%3E">From<UdpSocket></a><a href="#impl-FromRawFd">FromRawFd</a><a href="#impl-IntoRawFd">IntoRawFd</a><a href="#impl-Read">Read</a><a href="#impl-Write">Write</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="index.html">socket2</a></p><script>window.sidebarCurrent = {name: "Socket", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||
<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">−</span>]</a></span><a class="srclink" href="../src/socket2/socket.rs.html#53-56" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">socket2</a>::<wbr><a class="struct" href="">Socket</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Socket { /* fields omitted */ }</pre></div><div class="docblock"><p>Newtype, owned, wrapper around a system socket.</p>
|
||
<p>This type simply wraps an instance of a file descriptor (<code>c_int</code>) on Unix
|
||
and an instance of <code>SOCKET</code> on Windows. This is the main type exported by
|
||
this crate and is intended to mirror the raw semantics of sockets on
|
||
platforms as closely as possible. Almost all methods correspond to
|
||
precisely one libc or OS API call which is essentially just a "Rustic
|
||
translation" of what's below.</p>
|
||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">net</span>::<span class="ident">SocketAddr</span>;
|
||
<span class="kw">use</span> <span class="ident">socket2</span>::{<span class="ident">Socket</span>, <span class="ident">Domain</span>, <span class="ident">Type</span>, <span class="ident">SockAddr</span>};
|
||
|
||
<span class="comment">// create a TCP listener bound to two addresses</span>
|
||
<span class="kw">let</span> <span class="ident">socket</span> <span class="op">=</span> <span class="ident">Socket</span>::<span class="ident">new</span>(<span class="ident">Domain</span>::<span class="ident">ipv4</span>(), <span class="ident">Type</span>::<span class="ident">stream</span>(), <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
|
||
|
||
<span class="ident">socket</span>.<span class="ident">bind</span>(<span class="kw-2">&</span><span class="string">"127.0.0.1:12345"</span>.<span class="ident">parse</span>::<span class="op"><</span><span class="ident">SocketAddr</span><span class="op">></span>().<span class="ident">unwrap</span>().<span class="ident">into</span>()).<span class="ident">unwrap</span>();
|
||
<span class="ident">socket</span>.<span class="ident">bind</span>(<span class="kw-2">&</span><span class="string">"127.0.0.1:12346"</span>.<span class="ident">parse</span>::<span class="op"><</span><span class="ident">SocketAddr</span><span class="op">></span>().<span class="ident">unwrap</span>().<span class="ident">into</span>()).<span class="ident">unwrap</span>();
|
||
<span class="ident">socket</span>.<span class="ident">listen</span>(<span class="number">128</span>).<span class="ident">unwrap</span>();
|
||
|
||
<span class="kw">let</span> <span class="ident">listener</span> <span class="op">=</span> <span class="ident">socket</span>.<span class="ident">into_tcp_listener</span>();
|
||
<span class="comment">// ...</span></pre></div>
|
||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#58-835" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(<br> domain: <a class="struct" href="../socket2/struct.Domain.html" title="struct socket2::Domain">Domain</a>, <br> type_: <a class="struct" href="../socket2/struct.Type.html" title="struct socket2::Type">Type</a>, <br> protocol: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../socket2/struct.Protocol.html" title="struct socket2::Protocol">Protocol</a>><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#64-69" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new socket ready to be configured.</p>
|
||
<p>This function corresponds to <code>socket(2)</code> and simply creates a new
|
||
socket, no other configuration is done and further functions must be
|
||
invoked to configure this socket.</p>
|
||
</div><h4 id="method.into_tcp_stream" class="method"><code>pub fn <a href="#method.into_tcp_stream" class="fnname">into_tcp_stream</a>(self) -> <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 class="srclink" href="../src/socket2/socket.rs.html#89-91" title="goto source code">[src]</a></h4><div class="docblock"><p>Consumes this <code>Socket</code>, converting it to a <code>TcpStream</code>.</p>
|
||
</div><h4 id="method.into_tcp_listener" class="method"><code>pub fn <a href="#method.into_tcp_listener" class="fnname">into_tcp_listener</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">TcpListener</a></code><a class="srclink" href="../src/socket2/socket.rs.html#94-96" title="goto source code">[src]</a></h4><div class="docblock"><p>Consumes this <code>Socket</code>, converting it to a <code>TcpListener</code>.</p>
|
||
</div><h4 id="method.into_udp_socket" class="method"><code>pub fn <a href="#method.into_udp_socket" class="fnname">into_udp_socket</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/udp/struct.UdpSocket.html" title="struct std::net::udp::UdpSocket">UdpSocket</a></code><a class="srclink" href="../src/socket2/socket.rs.html#99-101" title="goto source code">[src]</a></h4><div class="docblock"><p>Consumes this <code>Socket</code>, converting it to a <code>UdpSocket</code>.</p>
|
||
</div><h4 id="method.connect" class="method"><code>pub fn <a href="#method.connect" class="fnname">connect</a>(&self, addr: &<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#137-139" title="goto source code">[src]</a></h4><div class="docblock"><p>Initiate a connection on this socket to the specified address.</p>
|
||
<p>This function directly corresponds to the connect(2) function on Windows
|
||
and Unix.</p>
|
||
<p>An error will be returned if <code>listen</code> or <code>connect</code> has already been
|
||
called on this builder.</p>
|
||
</div><h4 id="method.connect_timeout" class="method"><code>pub fn <a href="#method.connect_timeout" class="fnname">connect_timeout</a>(&self, addr: &<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>, timeout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#160-162" title="goto source code">[src]</a></h4><div class="docblock"><p>Initiate a connection on this socket to the specified address, only
|
||
only waiting for a certain period of time for the connection to be
|
||
established.</p>
|
||
<p>Unlike many other methods on <code>Socket</code>, this does <em>not</em> correspond to a
|
||
single C function. It sets the socket to nonblocking mode, connects via
|
||
connect(2), and then waits for the connection to complete with poll(2)
|
||
on Unix and select on Windows. When the connection is complete, the
|
||
socket is set back to blocking mode. On Unix, this will loop over
|
||
<code>EINTR</code> errors.</p>
|
||
<h1 id="warnings" class="section-header"><a href="#warnings">Warnings</a></h1>
|
||
<p>The nonblocking state of the socket is overridden by this function -
|
||
it will be returned in blocking mode on success, and in an indeterminate
|
||
state on failure.</p>
|
||
<p>If the connection request times out, it may still be processing in the
|
||
background - a second call to <code>connect</code> or <code>connect_timeout</code> may fail.</p>
|
||
</div><h4 id="method.bind" class="method"><code>pub fn <a href="#method.bind" class="fnname">bind</a>(&self, addr: &<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#168-170" title="goto source code">[src]</a></h4><div class="docblock"><p>Binds this socket to the specified address.</p>
|
||
<p>This function directly corresponds to the bind(2) function on Windows
|
||
and Unix.</p>
|
||
</div><h4 id="method.listen" class="method"><code>pub fn <a href="#method.listen" class="fnname">listen</a>(&self, backlog: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#180-182" title="goto source code">[src]</a></h4><div class="docblock"><p>Mark a socket as ready to accept incoming connection requests using
|
||
accept()</p>
|
||
<p>This function directly corresponds to the listen(2) function on Windows
|
||
and Unix.</p>
|
||
<p>An error will be returned if <code>listen</code> or <code>connect</code> has already been
|
||
called on this builder.</p>
|
||
</div><h4 id="method.accept" class="method"><code>pub fn <a href="#method.accept" class="fnname">accept</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>, <a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#189-193" title="goto source code">[src]</a></h4><div class="docblock"><p>Accept a new incoming connection from this listener.</p>
|
||
<p>This function will block the calling thread until a new connection is
|
||
established. When established, the corresponding <code>Socket</code> and the
|
||
remote peer's address will be returned.</p>
|
||
</div><h4 id="method.local_addr" class="method"><code>pub fn <a href="#method.local_addr" class="fnname">local_addr</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#196-198" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the socket address of the local half of this TCP connection.</p>
|
||
</div><h4 id="method.peer_addr" class="method"><code>pub fn <a href="#method.peer_addr" class="fnname">peer_addr</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#201-203" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the socket address of the remote peer of this TCP connection.</p>
|
||
</div><h4 id="method.try_clone" class="method"><code>pub fn <a href="#method.try_clone" class="fnname">try_clone</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#211-213" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new independently owned handle to the underlying socket.</p>
|
||
<p>The returned <code>TcpStream</code> is a reference to the same stream that this
|
||
object references. Both handles will read and write the same stream of
|
||
data, and options set on one stream will be propagated to the other
|
||
stream.</p>
|
||
</div><h4 id="method.take_error" class="method"><code>pub fn <a href="#method.take_error" class="fnname">take_error</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#220-222" title="goto source code">[src]</a></h4><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><h4 id="method.set_nonblocking" class="method"><code>pub fn <a href="#method.set_nonblocking" class="fnname">set_nonblocking</a>(&self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#228-230" title="goto source code">[src]</a></h4><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><h4 id="method.shutdown" class="method"><code>pub fn <a href="#method.shutdown" class="fnname">shutdown</a>(&self, how: <a class="enum" href="https://doc.rust-lang.org/nightly/std/net/enum.Shutdown.html" title="enum std::net::Shutdown">Shutdown</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#236-238" title="goto source code">[src]</a></h4><div class="docblock"><p>Shuts down the read, write, or both halves of this connection.</p>
|
||
<p>This function will cause all pending and future I/O on the specified
|
||
portions to return immediately with an appropriate value.</p>
|
||
</div><h4 id="method.recv" class="method"><code>pub fn <a href="#method.recv" class="fnname">recv</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#247-249" title="goto source code">[src]</a></h4><div class="docblock"><p>Receives data on the socket from the remote address to which it is
|
||
connected.</p>
|
||
<p>The <a href="#method.connect"><code>connect</code></a> method will connect this socket to a remote address. This
|
||
method will fail if the socket is not connected.</p>
|
||
</div><h4 id="method.recv_with_flags" class="method"><code>pub fn <a href="#method.recv_with_flags" class="fnname">recv_with_flags</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, flags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#255-257" title="goto source code">[src]</a></h4><div class="docblock"><p>Identical to <a href="#method.recv"><code>recv</code></a> but allows for specification of arbitrary flags to the underlying
|
||
<code>recv</code> call.</p>
|
||
</div><h4 id="method.recv_out_of_band" class="method"><code>pub fn <a href="#method.recv_out_of_band" class="fnname">recv_out_of_band</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#266-268" title="goto source code">[src]</a></h4><div class="docblock"><p>Receives out-of-band (OOB) data on the socket from the remote address to
|
||
which it is connected by setting the <code>MSG_OOB</code> flag for this call.</p>
|
||
<p>For more information, see <a href="#method.recv"><code>recv</code></a>, <a href="#method.out_of_band_inline"><code>out_of_band_inline</code></a>.</p>
|
||
</div><h4 id="method.peek" class="method"><code>pub fn <a href="#method.peek" class="fnname">peek</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#276-278" title="goto source code">[src]</a></h4><div class="docblock"><p>Receives data on the socket from the remote adress to which it is
|
||
connected, without removing that data from the queue. On success,
|
||
returns the number of bytes peeked.</p>
|
||
<p>Successive calls return the same data. This is accomplished by passing
|
||
<code>MSG_PEEK</code> as a flag to the underlying <code>recv</code> system call.</p>
|
||
</div><h4 id="method.recv_from" class="method"><code>pub fn <a href="#method.recv_from" class="fnname">recv_from</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#282-284" title="goto source code">[src]</a></h4><div class="docblock"><p>Receives data from the socket. On success, returns the number of bytes
|
||
read and the address from whence the data came.</p>
|
||
</div><h4 id="method.recv_from_with_flags" class="method"><code>pub fn <a href="#method.recv_from_with_flags" class="fnname">recv_from_with_flags</a>(<br> &self, <br> buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br> flags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#290-296" title="goto source code">[src]</a></h4><div class="docblock"><p>Identical to <a href="#method.recv_from"><code>recv_from</code></a> but allows for specification of arbitrary flags to the underlying
|
||
<code>recvfrom</code> call.</p>
|
||
</div><h4 id="method.peek_from" class="method"><code>pub fn <a href="#method.peek_from" class="fnname">peek_from</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#305-307" title="goto source code">[src]</a></h4><div class="docblock"><p>Receives data from the socket, without removing it from the queue.</p>
|
||
<p>Successive calls return the same data. This is accomplished by passing
|
||
<code>MSG_PEEK</code> as a flag to the underlying <code>recvfrom</code> system call.</p>
|
||
<p>On success, returns the number of bytes peeked and the address from
|
||
whence the data came.</p>
|
||
</div><h4 id="method.send" class="method"><code>pub fn <a href="#method.send" class="fnname">send</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#315-317" title="goto source code">[src]</a></h4><div class="docblock"><p>Sends data on the socket to a connected peer.</p>
|
||
<p>This is typically used on TCP sockets or datagram sockets which have
|
||
been connected.</p>
|
||
<p>On success returns the number of bytes that were sent.</p>
|
||
</div><h4 id="method.send_with_flags" class="method"><code>pub fn <a href="#method.send_with_flags" class="fnname">send_with_flags</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, flags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#323-325" title="goto source code">[src]</a></h4><div class="docblock"><p>Identical to <a href="#method.send"><code>send</code></a> but allows for specification of arbitrary flags to the underlying
|
||
<code>send</code> call.</p>
|
||
</div><h4 id="method.send_out_of_band" class="method"><code>pub fn <a href="#method.send_out_of_band" class="fnname">send_out_of_band</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#334-336" title="goto source code">[src]</a></h4><div class="docblock"><p>Sends out-of-band (OOB) data on the socket to connected peer
|
||
by setting the <code>MSG_OOB</code> flag for this call.</p>
|
||
<p>For more information, see <a href="#method.send"><code>send</code></a>, <a href="#method.out_of_band_inline"><code>out_of_band_inline</code></a>.</p>
|
||
</div><h4 id="method.send_to" class="method"><code>pub fn <a href="#method.send_to" class="fnname">send_to</a>(&self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, addr: &<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#343-345" title="goto source code">[src]</a></h4><div class="docblock"><p>Sends data on the socket to the given address. On success, returns the
|
||
number of bytes written.</p>
|
||
<p>This is typically used on UDP or datagram-oriented sockets. On success
|
||
returns the number of bytes that were sent.</p>
|
||
</div><h4 id="method.send_to_with_flags" class="method"><code>pub fn <a href="#method.send_to_with_flags" class="fnname">send_to_with_flags</a>(<br> &self, <br> buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br> addr: &<a class="struct" href="../socket2/struct.SockAddr.html" title="struct socket2::SockAddr">SockAddr</a>, <br> flags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#351-353" title="goto source code">[src]</a></h4><div class="docblock"><p>Identical to <a href="#method.send_to"><code>send_to</code></a> but allows for specification of arbitrary flags to the underlying
|
||
<code>sendto</code> call.</p>
|
||
</div><h4 id="method.ttl" class="method"><code>pub fn <a href="#method.ttl" class="fnname">ttl</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#362-364" title="goto source code">[src]</a></h4><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="#method.set_ttl"><code>set_ttl</code></a>.</p>
|
||
</div><h4 id="method.set_ttl" class="method"><code>pub fn <a href="#method.set_ttl" class="fnname">set_ttl</a>(&self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#370-372" title="goto source code">[src]</a></h4><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><h4 id="method.mss" class="method"><code>pub fn <a href="#method.mss" class="fnname">mss</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#379-381" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>TCP_MAXSEG</code> option on this socket.</p>
|
||
<p>The <code>TCP_MAXSEG</code> option denotes the TCP Maximum Segment
|
||
Size and is only available on TCP sockets.</p>
|
||
</div><h4 id="method.set_mss" class="method"><code>pub fn <a href="#method.set_mss" class="fnname">set_mss</a>(&self, mss: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#388-390" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>TCP_MAXSEG</code> option on this socket.</p>
|
||
<p>The <code>TCP_MAXSEG</code> option denotes the TCP Maximum Segment
|
||
Size and is only available on TCP sockets.</p>
|
||
</div><h4 id="method.mark" class="method"><code>pub fn <a href="#method.mark" class="fnname">mark</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#400-402" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value for the <code>SO_MARK</code> option on this socket.</p>
|
||
<p>This value gets the socket mark field for each packet sent through
|
||
this socket.</p>
|
||
<p>This function is only available on Linux and requires the
|
||
<code>CAP_NET_ADMIN</code> capability.</p>
|
||
</div><h4 id="method.set_mark" class="method"><code>pub fn <a href="#method.set_mark" class="fnname">set_mark</a>(&self, mark: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#413-415" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value for the <code>SO_MARK</code> option on this socket.</p>
|
||
<p>This value sets the socket mark field for each packet sent through
|
||
this socket. Changing the mark can be used for mark-based routing
|
||
without netfilter or for packet filtering.</p>
|
||
<p>This function is only available on Linux and requires the
|
||
<code>CAP_NET_ADMIN</code> capability.</p>
|
||
</div><h4 id="method.device" class="method"><code>pub fn <a href="#method.device" class="fnname">device</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CString.html" title="struct std::ffi::c_str::CString">CString</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#423-425" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value for the <code>SO_BINDTODEVICE</code> option on this socket.</p>
|
||
<p>This value gets the socket binded device's interface name.</p>
|
||
<p>This function is only available on Linux.</p>
|
||
</div><h4 id="method.bind_device" class="method"><code>pub fn <a href="#method.bind_device" class="fnname">bind_device</a>(&self, interface: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#437-439" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value for the <code>SO_BINDTODEVICE</code> option on this socket.</p>
|
||
<p>If a socket is bound to an interface, only packets received from that
|
||
particular interface are processed by the socket. Note that this only
|
||
works for some socket types, particularly <code>AF_INET</code> sockets.</p>
|
||
<p>If <code>interface</code> is <code>None</code> or an empty string it removes the binding.</p>
|
||
<p>This function is only available on Linux.</p>
|
||
</div><h4 id="method.unicast_hops_v6" class="method"><code>pub fn <a href="#method.unicast_hops_v6" class="fnname">unicast_hops_v6</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#444-446" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IPV6_UNICAST_HOPS</code> option for this socket.</p>
|
||
<p>Specifies the hop limit for ipv6 unicast packets</p>
|
||
</div><h4 id="method.set_unicast_hops_v6" class="method"><code>pub fn <a href="#method.set_unicast_hops_v6" class="fnname">set_unicast_hops_v6</a>(&self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#451-453" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value for the <code>IPV6_UNICAST_HOPS</code> option on this socket.</p>
|
||
<p>Specifies the hop limit for ipv6 unicast packets</p>
|
||
</div><h4 id="method.only_v6" class="method"><code>pub fn <a href="#method.only_v6" class="fnname">only_v6</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#460-462" title="goto source code">[src]</a></h4><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="#method.set_only_v6"><code>set_only_v6</code></a>.</p>
|
||
</div><h4 id="method.set_only_v6" class="method"><code>pub fn <a href="#method.set_only_v6" class="fnname">set_only_v6</a>(&self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#472-474" title="goto source code">[src]</a></h4><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><h4 id="method.read_timeout" class="method"><code>pub fn <a href="#method.read_timeout" class="fnname">read_timeout</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#479-481" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the read timeout of this socket.</p>
|
||
<p>If the timeout is <code>None</code>, then <code>read</code> calls will block indefinitely.</p>
|
||
</div><h4 id="method.set_read_timeout" class="method"><code>pub fn <a href="#method.set_read_timeout" class="fnname">set_read_timeout</a>(&self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#488-490" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the read timeout to the timeout specified.</p>
|
||
<p>If the value specified is <code>None</code>, then <code>read</code> calls will block
|
||
indefinitely. It is an error to pass the zero <code>Duration</code> to this
|
||
method.</p>
|
||
</div><h4 id="method.write_timeout" class="method"><code>pub fn <a href="#method.write_timeout" class="fnname">write_timeout</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#495-497" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the write timeout of this socket.</p>
|
||
<p>If the timeout is <code>None</code>, then <code>write</code> calls will block indefinitely.</p>
|
||
</div><h4 id="method.set_write_timeout" class="method"><code>pub fn <a href="#method.set_write_timeout" class="fnname">set_write_timeout</a>(&self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#504-506" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the write timeout to the timeout specified.</p>
|
||
<p>If the value specified is <code>None</code>, then <code>write</code> calls will block
|
||
indefinitely. It is an error to pass the zero <code>Duration</code> to this
|
||
method.</p>
|
||
</div><h4 id="method.nodelay" class="method"><code>pub fn <a href="#method.nodelay" class="fnname">nodelay</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#513-515" title="goto source code">[src]</a></h4><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="#method.set_nodelay"><code>set_nodelay</code></a>.</p>
|
||
</div><h4 id="method.set_nodelay" class="method"><code>pub fn <a href="#method.set_nodelay" class="fnname">set_nodelay</a>(&self, nodelay: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#524-526" title="goto source code">[src]</a></h4><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><h4 id="method.broadcast" class="method"><code>pub fn <a href="#method.broadcast" class="fnname">broadcast</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#532-534" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>SO_BROADCAST</code> option for this socket.</p>
|
||
<p>When enabled, this socket is allowed to send packets to a broadcast
|
||
address.</p>
|
||
</div><h4 id="method.set_broadcast" class="method"><code>pub fn <a href="#method.set_broadcast" class="fnname">set_broadcast</a>(&self, broadcast: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#542-544" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>SO_BROADCAST</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_broadcast"><code>set_broadcast</code></a>.</p>
|
||
</div><h4 id="method.multicast_loop_v4" class="method"><code>pub fn <a href="#method.multicast_loop_v4" class="fnname">multicast_loop_v4</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#552-554" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IP_MULTICAST_LOOP</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_loop_v4"><code>set_multicast_loop_v4</code></a>.</p>
|
||
</div><h4 id="method.set_multicast_loop_v4" class="method"><code>pub fn <a href="#method.set_multicast_loop_v4" class="fnname">set_multicast_loop_v4</a>(&self, multicast_loop_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#560-562" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IP_MULTICAST_LOOP</code> option for this socket.</p>
|
||
<p>If enabled, multicast packets will be looped back to the local socket.
|
||
Note that this may not have any affect on IPv6 sockets.</p>
|
||
</div><h4 id="method.multicast_ttl_v4" class="method"><code>pub fn <a href="#method.multicast_ttl_v4" class="fnname">multicast_ttl_v4</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#570-572" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IP_MULTICAST_TTL</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_ttl_v4"><code>set_multicast_ttl_v4</code></a>.</p>
|
||
</div><h4 id="method.set_multicast_ttl_v4" class="method"><code>pub fn <a href="#method.set_multicast_ttl_v4" class="fnname">set_multicast_ttl_v4</a>(&self, multicast_ttl_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#581-583" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IP_MULTICAST_TTL</code> option for this socket.</p>
|
||
<p>Indicates the time-to-live value of outgoing multicast packets for
|
||
this socket. The default value is 1 which means that multicast packets
|
||
don't leave the local network unless explicitly requested.</p>
|
||
<p>Note that this may not have any affect on IPv6 sockets.</p>
|
||
</div><h4 id="method.multicast_hops_v6" class="method"><code>pub fn <a href="#method.multicast_hops_v6" class="fnname">multicast_hops_v6</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#591-593" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IPV6_MULTICAST_HOPS</code> option for this socket</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_hops_v6"><code>set_multicast_hops_v6</code></a>.</p>
|
||
</div><h4 id="method.set_multicast_hops_v6" class="method"><code>pub fn <a href="#method.set_multicast_hops_v6" class="fnname">set_multicast_hops_v6</a>(&self, hops: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#600-602" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IPV6_MULTICAST_HOPS</code> option for this socket</p>
|
||
<p>Indicates the number of "routers" multicast packets will transit for
|
||
this socket. The default value is 1 which means that multicast packets
|
||
don't leave the local network unless explicitly requested.</p>
|
||
</div><h4 id="method.multicast_if_v4" class="method"><code>pub fn <a href="#method.multicast_if_v4" class="fnname">multicast_if_v4</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#612-614" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IP_MULTICAST_IF</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_if_v4"><code>set_multicast_if_v4</code></a>.</p>
|
||
<p>Returns the interface to use for routing multicast packets.</p>
|
||
</div><h4 id="method.set_multicast_if_v4" class="method"><code>pub fn <a href="#method.set_multicast_if_v4" class="fnname">set_multicast_if_v4</a>(&self, interface: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#619-621" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IP_MULTICAST_IF</code> option for this socket.</p>
|
||
<p>Specifies the interface to use for routing multicast packets.</p>
|
||
</div><h4 id="method.multicast_if_v6" class="method"><code>pub fn <a href="#method.multicast_if_v6" class="fnname">multicast_if_v6</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#631-633" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IPV6_MULTICAST_IF</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_if_v6"><code>set_multicast_if_v6</code></a>.</p>
|
||
<p>Returns the interface to use for routing multicast packets.</p>
|
||
</div><h4 id="method.set_multicast_if_v6" class="method"><code>pub fn <a href="#method.set_multicast_if_v6" class="fnname">set_multicast_if_v6</a>(&self, interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#640-642" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IPV6_MULTICAST_IF</code> option for this socket.</p>
|
||
<p>Specifies the interface to use for routing multicast packets. Unlike ipv4, this
|
||
is generally required in ipv6 contexts where network routing prefixes may
|
||
overlap.</p>
|
||
</div><h4 id="method.multicast_loop_v6" class="method"><code>pub fn <a href="#method.multicast_loop_v6" class="fnname">multicast_loop_v6</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#650-652" title="goto source code">[src]</a></h4><div class="docblock"><p>Gets the value of the <code>IPV6_MULTICAST_LOOP</code> option for this socket.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.set_multicast_loop_v6"><code>set_multicast_loop_v6</code></a>.</p>
|
||
</div><h4 id="method.set_multicast_loop_v6" class="method"><code>pub fn <a href="#method.set_multicast_loop_v6" class="fnname">set_multicast_loop_v6</a>(&self, multicast_loop_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#658-660" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the value of the <code>IPV6_MULTICAST_LOOP</code> option for this socket.</p>
|
||
<p>Controls whether this socket sees the multicast packets it sends itself.
|
||
Note that this may not have any affect on IPv4 sockets.</p>
|
||
</div><h4 id="method.join_multicast_v4" class="method"><code>pub fn <a href="#method.join_multicast_v4" class="fnname">join_multicast_v4</a>(<br> &self, <br> multiaddr: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>, <br> interface: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#669-671" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes an operation of the <code>IP_ADD_MEMBERSHIP</code> type.</p>
|
||
<p>This function specifies a new multicast group for this socket to join.
|
||
The address must be a valid multicast address, and <code>interface</code> is the
|
||
address of the local interface with which the system should join the
|
||
multicast group. If it's equal to <code>INADDR_ANY</code> then an appropriate
|
||
interface is chosen by the system.</p>
|
||
</div><h4 id="method.join_multicast_v6" class="method"><code>pub fn <a href="#method.join_multicast_v6" class="fnname">join_multicast_v6</a>(<br> &self, <br> multiaddr: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv6Addr.html" title="struct std::net::ip::Ipv6Addr">Ipv6Addr</a>, <br> interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#678-680" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes an operation of the <code>IPV6_ADD_MEMBERSHIP</code> type.</p>
|
||
<p>This function specifies a new multicast group for this socket to join.
|
||
The address must be a valid multicast address, and <code>interface</code> is the
|
||
index of the interface to join/leave (or 0 to indicate any interface).</p>
|
||
</div><h4 id="method.leave_multicast_v4" class="method"><code>pub fn <a href="#method.leave_multicast_v4" class="fnname">leave_multicast_v4</a>(<br> &self, <br> multiaddr: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>, <br> interface: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#688-690" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes an operation of the <code>IP_DROP_MEMBERSHIP</code> type.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.join_multicast_v4"><code>join_multicast_v4</code></a>.</p>
|
||
</div><h4 id="method.leave_multicast_v6" class="method"><code>pub fn <a href="#method.leave_multicast_v6" class="fnname">leave_multicast_v6</a>(<br> &self, <br> multiaddr: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv6Addr.html" title="struct std::net::ip::Ipv6Addr">Ipv6Addr</a>, <br> interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#698-700" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes an operation of the <code>IPV6_DROP_MEMBERSHIP</code> type.</p>
|
||
<p>For more information about this option, see
|
||
<a href="#method.join_multicast_v6"><code>join_multicast_v6</code></a>.</p>
|
||
</div><h4 id="method.linger" class="method"><code>pub fn <a href="#method.linger" class="fnname">linger</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#704-706" title="goto source code">[src]</a></h4><div class="docblock"><p>Reads the linger duration for this socket by getting the SO_LINGER
|
||
option</p>
|
||
</div><h4 id="method.set_linger" class="method"><code>pub fn <a href="#method.set_linger" class="fnname">set_linger</a>(&self, dur: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#709-711" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the linger duration of this socket by setting the SO_LINGER option</p>
|
||
</div><h4 id="method.reuse_address" class="method"><code>pub fn <a href="#method.reuse_address" class="fnname">reuse_address</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#714-716" title="goto source code">[src]</a></h4><div class="docblock"><p>Check the <code>SO_REUSEADDR</code> option on this socket.</p>
|
||
</div><h4 id="method.set_reuse_address" class="method"><code>pub fn <a href="#method.set_reuse_address" class="fnname">set_reuse_address</a>(&self, reuse: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#723-725" title="goto source code">[src]</a></h4><div class="docblock"><p>Set value for the <code>SO_REUSEADDR</code> option on this socket.</p>
|
||
<p>This indicates that futher calls to <code>bind</code> may allow reuse of local
|
||
addresses. For IPv4 sockets this means that a socket may bind even when
|
||
there's a socket already listening on this port.</p>
|
||
</div><h4 id="method.recv_buffer_size" class="method"><code>pub fn <a href="#method.recv_buffer_size" class="fnname">recv_buffer_size</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#733-735" title="goto source code">[src]</a></h4><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="#method.set_recv_buffer_size"><code>set_recv_buffer_size</code></a>.</p>
|
||
</div><h4 id="method.set_recv_buffer_size" class="method"><code>pub fn <a href="#method.set_recv_buffer_size" class="fnname">set_recv_buffer_size</a>(&self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#741-743" title="goto source code">[src]</a></h4><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><h4 id="method.send_buffer_size" class="method"><code>pub fn <a href="#method.send_buffer_size" class="fnname">send_buffer_size</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#750-752" title="goto source code">[src]</a></h4><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="#method.set_send_buffer"><code>set_send_buffer</code></a>.</p>
|
||
</div><h4 id="method.set_send_buffer_size" class="method"><code>pub fn <a href="#method.set_send_buffer_size" class="fnname">set_send_buffer_size</a>(&self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#758-760" title="goto source code">[src]</a></h4><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><h4 id="method.keepalive" class="method"><code>pub fn <a href="#method.keepalive" class="fnname">keepalive</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>></code><a class="srclink" href="../src/socket2/socket.rs.html#768-770" title="goto source code">[src]</a></h4><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="#method.set_keepalive"><code>set_keepalive</code></a>.</p>
|
||
</div><h4 id="method.set_keepalive" class="method"><code>pub fn <a href="#method.set_keepalive" class="fnname">set_keepalive</a>(&self, keepalive: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#784-786" title="goto source code">[src]</a></h4><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><h4 id="method.out_of_band_inline" class="method"><code>pub fn <a href="#method.out_of_band_inline" class="fnname">out_of_band_inline</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#792-794" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the value of the <code>SO_OOBINLINE</code> flag of the underlying socket.
|
||
For more information about this option, see <a href="#method.set_out_of_band_inline"><code>set_out_of_band_inline</code></a>.</p>
|
||
</div><h4 id="method.set_out_of_band_inline" class="method"><code>pub fn <a href="#method.set_out_of_band_inline" class="fnname">set_out_of_band_inline</a>(&self, oob_inline: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#802-804" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the <code>SO_OOBINLINE</code> flag of the underlying socket.
|
||
as per RFC6093, TCP sockets using the Urgent mechanism
|
||
are encouraged to set this flag.</p>
|
||
<p>If this flag is not set, the <code>MSG_OOB</code> flag is needed
|
||
while <code>recv</code>ing to aquire the out-of-band data.</p>
|
||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-AsRawFd" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.AsRawFd.html" title="trait std::sys::unix::ext::io::AsRawFd">AsRawFd</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-AsRawFd" class="anchor"></a><a class="srclink" href="../src/socket2/sys/unix.rs.html#1050-1054" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_raw_fd" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.AsRawFd.html#tymethod.as_raw_fd" class="fnname">as_raw_fd</a>(&self) -> <a class="type" href="../libc/unix/type.c_int.html" title="type libc::unix::c_int">c_int</a></code><a class="srclink" href="../src/socket2/sys/unix.rs.html#1051-1053" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Extracts the raw file descriptor. <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.AsRawFd.html#tymethod.as_raw_fd">Read more</a></p>
|
||
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#869-873" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/socket2/socket.rs.html#870-872" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id="impl-From%3CSocket%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</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-From%3CSocket%3E" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#926-930" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>) -> <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 class="srclink" href="../src/socket2/socket.rs.html#927-929" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-From%3CSocket%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">TcpListener</a></code><a href="#impl-From%3CSocket%3E-1" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#932-936" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">TcpListener</a></code><a class="srclink" href="../src/socket2/socket.rs.html#933-935" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-From%3CSocket%3E-2" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/udp/struct.UdpSocket.html" title="struct std::net::udp::UdpSocket">UdpSocket</a></code><a href="#impl-From%3CSocket%3E-2" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#938-942" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-5" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/udp/struct.UdpSocket.html" title="struct std::net::udp::UdpSocket">UdpSocket</a></code><a class="srclink" href="../src/socket2/socket.rs.html#939-941" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-From%3CTcpListener%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">TcpListener</a>> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-From%3CTcpListener%3E" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#883-889" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">TcpListener</a>) -> <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span></code></span></div></span></span></code><a class="srclink" href="../src/socket2/socket.rs.html#884-888" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-From%3CTcpStream%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpStream.html" title="struct std::net::tcp::TcpStream">TcpStream</a>> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-From%3CTcpStream%3E" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#875-881" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpStream.html" title="struct std::net::tcp::TcpStream">TcpStream</a>) -> <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span></code></span></div></span></span></code><a class="srclink" href="../src/socket2/socket.rs.html#876-880" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-From%3CUdpSocket%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/udp/struct.UdpSocket.html" title="struct std::net::udp::UdpSocket">UdpSocket</a>> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-From%3CUdpSocket%3E" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#891-897" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(socket: <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/udp/struct.UdpSocket.html" title="struct std::net::udp::UdpSocket">UdpSocket</a>) -> <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span></code></span></div></span></span></code><a class="srclink" href="../src/socket2/socket.rs.html#892-896" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-FromRawFd" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.FromRawFd.html" title="trait std::sys::unix::ext::io::FromRawFd">FromRawFd</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-FromRawFd" class="anchor"></a><a class="srclink" href="../src/socket2/sys/unix.rs.html#1062-1068" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from_raw_fd" class="method hidden"><code>unsafe fn <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.FromRawFd.html#tymethod.from_raw_fd" class="fnname">from_raw_fd</a>(fd: <a class="type" href="../libc/unix/type.c_int.html" title="type libc::unix::c_int">c_int</a>) -> <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></span></code></span></div></span></span></code><a class="srclink" href="../src/socket2/sys/unix.rs.html#1063-1067" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Constructs a new instance of <code>Self</code> from the given raw file
|
||
descriptor. <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.FromRawFd.html#tymethod.from_raw_fd">Read more</a></p>
|
||
</div></div><h3 id="impl-IntoRawFd" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.IntoRawFd.html" title="trait std::sys::unix::ext::io::IntoRawFd">IntoRawFd</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-IntoRawFd" class="anchor"></a><a class="srclink" href="../src/socket2/sys/unix.rs.html#1056-1060" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into_raw_fd" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.IntoRawFd.html#tymethod.into_raw_fd" class="fnname">into_raw_fd</a>(self) -> <a class="type" href="../libc/unix/type.c_int.html" title="type libc::unix::c_int">c_int</a></code><a class="srclink" href="../src/socket2/sys/unix.rs.html#1057-1059" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Consumes this object, returning the raw underlying file descriptor. <a href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/io/trait.IntoRawFd.html#tymethod.into_raw_fd">Read more</a></p>
|
||
</div></div><h3 id="impl-Read" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Read" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#837-841" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.read" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read" class="fnname">read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#838-840" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Pull some bytes from this source into the specified buffer, returning
|
||
how many bytes were read. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read">Read more</a></p>
|
||
</div><h4 id="method.read_vectored" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored" class="fnname">read_vectored</a>(<br> &mut self, <br> bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#574-576" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Like <code>read</code>, except that it reads into a slice of buffers. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored">Read more</a></p>
|
||
</div><h4 id="method.is_read_vectored" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored" class="fnname">is_read_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#587-589" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>can_vector</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Read</code>er has an efficient <code>read_vectored</code>
|
||
implementation. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored">Read more</a></p>
|
||
</div><h4 id="method.initializer" class="method hidden"><code>pub unsafe fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.initializer" class="fnname">initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#612-614" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>read_initializer</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Read</code>er can work with buffers of uninitialized
|
||
memory. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.initializer">Read more</a></p>
|
||
</div><h4 id="method.read_to_end" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end" class="fnname">read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#663-665" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read all bytes until EOF in this source, placing them into <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end">Read more</a></p>
|
||
</div><h4 id="method.read_to_string" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string" class="fnname">read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#706-717" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read all bytes until EOF in this source, appending them to <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string">Read more</a></p>
|
||
</div><h4 id="method.read_exact" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact" class="fnname">read_exact</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#770-787" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact">Read more</a></p>
|
||
</div><h4 id="method.by_ref" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#824-829" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates a "by reference" adaptor for this instance of <code>Read</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref">Read more</a></p>
|
||
</div><h4 id="method.bytes" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes" class="fnname">bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#861-866" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Transforms this <code>Read</code> instance to an <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> over its bytes. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes">Read more</a></p>
|
||
</div><h4 id="method.chain" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain" class="fnname">chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>, </span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#899-904" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an adaptor which will chain this stream with another. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain">Read more</a></p>
|
||
</div><h4 id="method.take" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take" class="fnname">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#938-943" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an adaptor which will read at most <code>limit</code> bytes from it. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take">Read more</a></p>
|
||
</div></div><h3 id="impl-Read-1" class="impl"><code class="in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Read-1" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#843-847" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.read-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read" class="fnname">read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#844-846" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Pull some bytes from this source into the specified buffer, returning
|
||
how many bytes were read. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read">Read more</a></p>
|
||
</div><h4 id="method.read_vectored-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored" class="fnname">read_vectored</a>(<br> &mut self, <br> bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#574-576" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Like <code>read</code>, except that it reads into a slice of buffers. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored">Read more</a></p>
|
||
</div><h4 id="method.is_read_vectored-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored" class="fnname">is_read_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#587-589" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>can_vector</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Read</code>er has an efficient <code>read_vectored</code>
|
||
implementation. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored">Read more</a></p>
|
||
</div><h4 id="method.initializer-1" class="method hidden"><code>pub unsafe fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.initializer" class="fnname">initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#612-614" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>read_initializer</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Read</code>er can work with buffers of uninitialized
|
||
memory. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.initializer">Read more</a></p>
|
||
</div><h4 id="method.read_to_end-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end" class="fnname">read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#663-665" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read all bytes until EOF in this source, placing them into <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end">Read more</a></p>
|
||
</div><h4 id="method.read_to_string-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string" class="fnname">read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#706-717" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read all bytes until EOF in this source, appending them to <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string">Read more</a></p>
|
||
</div><h4 id="method.read_exact-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact" class="fnname">read_exact</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#770-787" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact">Read more</a></p>
|
||
</div><h4 id="method.by_ref-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#824-829" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates a "by reference" adaptor for this instance of <code>Read</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref">Read more</a></p>
|
||
</div><h4 id="method.bytes-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes" class="fnname">bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#861-866" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Transforms this <code>Read</code> instance to an <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> over its bytes. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes">Read more</a></p>
|
||
</div><h4 id="method.chain-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain" class="fnname">chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>, </span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#899-904" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an adaptor which will chain this stream with another. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain">Read more</a></p>
|
||
</div><h4 id="method.take-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take" class="fnname">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#938-943" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an adaptor which will read at most <code>limit</code> bytes from it. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take">Read more</a></p>
|
||
</div></div><h3 id="impl-Write" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Write" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#849-857" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.write" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write" class="fnname">write</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#850-852" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Write a buffer into this writer, returning how many bytes were written. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write">Read more</a></p>
|
||
</div><h4 id="method.flush" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.flush" class="fnname">flush</a>(&mut self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#854-856" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Flush this output stream, ensuring that all intermediately buffered
|
||
contents reach their destination. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.flush">Read more</a></p>
|
||
</div><h4 id="method.write_vectored" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored" class="fnname">write_vectored</a>(&mut self, bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1304-1306" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Like <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write"><code>write</code></a>, except that it writes from a slice of buffers. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored">Read more</a></p>
|
||
</div><h4 id="method.is_write_vectored" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.is_write_vectored" class="fnname">is_write_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1319-1321" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>can_vector</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Write</code>r has an efficient <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored"><code>write_vectored</code></a>
|
||
implementation. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.is_write_vectored">Read more</a></p>
|
||
</div><h4 id="method.write_all" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all" class="fnname">write_all</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1381-1393" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempts to write an entire buffer into this writer. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all">Read more</a></p>
|
||
</div><h4 id="method.write_all_vectored" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all_vectored" class="fnname">write_all_vectored</a>(<br> &mut self, <br> bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1443-1458" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>write_all_vectored</code>)</div></div><div class='docblock hidden'><p>Attempts to write multiple buffers into this writer. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all_vectored">Read more</a></p>
|
||
</div><h4 id="method.write_fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_fmt" class="fnname">write_fmt</a>(&mut self, fmt: <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1496-1528" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Writes a formatted string into this writer, returning any error
|
||
encountered. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_fmt">Read more</a></p>
|
||
</div><h4 id="method.by_ref-2" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1552-1557" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates a "by reference" adaptor for this instance of <code>Write</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.by_ref">Read more</a></p>
|
||
</div></div><h3 id="impl-Write-1" class="impl"><code class="in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Write-1" class="anchor"></a><a class="srclink" href="../src/socket2/socket.rs.html#859-867" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.write-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write" class="fnname">write</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#860-862" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Write a buffer into this writer, returning how many bytes were written. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write">Read more</a></p>
|
||
</div><h4 id="method.flush-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.flush" class="fnname">flush</a>(&mut self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../src/socket2/socket.rs.html#864-866" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Flush this output stream, ensuring that all intermediately buffered
|
||
contents reach their destination. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.flush">Read more</a></p>
|
||
</div><h4 id="method.write_vectored-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored" class="fnname">write_vectored</a>(&mut self, bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1304-1306" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Like <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write"><code>write</code></a>, except that it writes from a slice of buffers. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored">Read more</a></p>
|
||
</div><h4 id="method.is_write_vectored-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.is_write_vectored" class="fnname">is_write_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1319-1321" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>can_vector</code>)</div></div><div class='docblock hidden'><p>Determines if this <code>Write</code>r has an efficient <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_vectored"><code>write_vectored</code></a>
|
||
implementation. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.is_write_vectored">Read more</a></p>
|
||
</div><h4 id="method.write_all-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all" class="fnname">write_all</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1381-1393" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempts to write an entire buffer into this writer. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all">Read more</a></p>
|
||
</div><h4 id="method.write_all_vectored-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all_vectored" class="fnname">write_all_vectored</a>(<br> &mut self, <br> bufs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1443-1458" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>write_all_vectored</code>)</div></div><div class='docblock hidden'><p>Attempts to write multiple buffers into this writer. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_all_vectored">Read more</a></p>
|
||
</div><h4 id="method.write_fmt-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_fmt" class="fnname">write_fmt</a>(&mut self, fmt: <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1496-1528" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Writes a formatted string into this writer, returning any error
|
||
encountered. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.write_fmt">Read more</a></p>
|
||
</div><h4 id="method.by_ref-3" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1552-1557" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates a "by reference" adaptor for this instance of <code>Write</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#method.by_ref">Read more</a></p>
|
||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/socket2/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/socket2/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/socket2/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/socket2/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../socket2/struct.Socket.html" title="struct socket2::Socket">Socket</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/socket2/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-6" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "socket2";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |