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

169 lines
86 KiB

5 years ago
<!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 `UdpSocketExt` trait in crate `net2`."><meta name="keywords" content="rust, rustlang, rust-lang, UdpSocketExt"><title>net2::UdpSocketExt - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../net2/index.html'><div class='logo-container'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo'></div></a><p class='location'>Trait UdpSocketExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.broadcast">broadcast</a><a href="#tymethod.connect">connect</a><a href="#tymethod.join_multicast_v4">join_multicast_v4</a><a href="#tymethod.join_multicast_v6">join_multicast_v6</a><a href="#tymethod.leave_multicast_v4">leave_multicast_v4</a><a href="#tymethod.leave_multicast_v6">leave_multicast_v6</a><a href="#tymethod.multicast_hops_v6">multicast_hops_v6</a><a href="#tymethod.multicast_if_v4">multicast_if_v4</a><a href="#tymethod.multicast_if_v6">multicast_if_v6</a><a href="#tymethod.multicast_loop_v4">multicast_loop_v4</a><a href="#tymethod.multicast_loop_v6">multicast_loop_v6</a><a href="#tymethod.multicast_ttl_v4">multicast_ttl_v4</a><a href="#tymethod.only_v6">only_v6</a><a href="#tymethod.read_timeout">read_timeout</a><a href="#tymethod.read_timeout_ms">read_timeout_ms</a><a href="#tymethod.recv">recv</a><a href="#tymethod.recv_buffer_size">recv_buffer_size</a><a href="#tymethod.send">send</a><a href="#tymethod.send_buffer_size">send_buffer_size</a><a href="#tymethod.set_broadcast">set_broadcast</a><a href="#tymethod.set_multicast_hops_v6">set_multicast_hops_v6</a><a href="#tymethod.set_multicast_if_v4">set_multicast_if_v4</a><a href="#tymethod.set_multicast_if_v6">set_multicast_if_v6</a><a href="#tymethod.set_multicast_loop_v4">set_multicast_loop_v4</a><a href="#tymethod.set_multicast_loop_v6">set_multicast_loop_v6</a><a href="#tymethod.set_multicast_ttl_v4">set_multicast_ttl_v4</a><a href="#tymethod.set_nonblocking">set_nonblocking</a><a href="#tymethod.set_only_v6">set_only_v6</a><a href="#tymethod.set_read_timeout">set_read_timeout</a><a href="#tymethod.set_read_timeout_ms">set_read_timeout_ms</a><a href="#tymethod.set_recv_buffer_size">set_recv_buffer_size</a><a href="#tymethod.set_send_buffer_size">set_send_buffer_size</a><a href="#tymethod.set_ttl">set_ttl</a><a href="#tymethod.set_unicast_hops_v6">set_unicast_hops_v6</a><a href="#tymethod.set_write_timeout">set_write_timeout</a><a href="#tymethod.set_write_timeout_ms">set_write_timeout_ms</a><a href="#tymethod.take_error">take_error</a><a href="#tymethod.ttl">ttl</a><a href="#tymethod.unicast_hops_v6">unicast_hops_v6</a><a href="#tymethod.write_timeout">write_timeout</a><a href="#tymethod.write_timeout_ms">write_timeout_ms</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-UdpSocketExt-for-UdpSocket">UdpSocket</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>net2</a></p><script>window.sidebarCurrent = {name: 'UdpSocketExt',
fn <a href='#tymethod.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_broadcast' class='fnname'>set_broadcast</a>(&amp;self, broadcast: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_loop_v4' class='fnname'>set_multicast_loop_v4</a>(&amp;self, multicast_loop_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_loop_v4' class='fnname'>multicast_loop_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_ttl_v4' class='fnname'>set_multicast_ttl_v4</a>(&amp;self, multicast_ttl_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_ttl_v4' class='fnname'>multicast_ttl_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_hops_v6' class='fnname'>set_multicast_hops_v6</a>(&amp;self, hops: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_hops_v6' class='fnname'>multicast_hops_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_loop_v6' class='fnname'>set_multicast_loop_v6</a>(&amp;self, multicast_loop_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_loop_v6' class='fnname'>multicast_loop_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_if_v4' class='fnname'>set_multicast_if_v4</a>(&amp;self, interface: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_if_v4' class='fnname'>multicast_if_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_multicast_if_v6' class='fnname'>set_multicast_if_v6</a>(&amp;self, interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.multicast_if_v6' class='fnname'>multicast_if_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_ttl' class='fnname'>set_ttl</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.ttl' class='fnname'>ttl</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_unicast_hops_v6' class='fnname'>set_unicast_hops_v6</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.unicast_hops_v6' class='fnname'>unicast_hops_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_only_v6' class='fnname'>set_only_v6</a>(&amp;self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.only_v6' class='fnname'>only_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.join_multicast_v4' class='fnname'>join_multicast_v4</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.join_multicast_v6' class='fnname'>join_multicast_v6</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.leave_multicast_v4' class='fnname'>leave_multicast_v4</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.leave_multicast_v6' class='fnname'>leave_multicast_v6</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_read_timeout_ms' class='fnname'>set_read_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.read_timeout_ms' class='fnname'>read_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.read_timeout' class='fnname'>read_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_write_timeout_ms' class='fnname'>set_write_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.write_timeout_ms' class='fnname'>write_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.write_timeout' class='fnname'>write_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.take_error' class='fnname'>take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.connect' class='fnname'>connect</a>&lt;A:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(&amp;self, addr: A) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.send' class='fnname'>send</a>(&amp;self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.recv' class='fnname'>recv</a>(&amp;self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.set_nonblocking' class='fnname'>set_nonblocking</a>(&amp;self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;;
}</pre></div><div class='docblock'><p>Extension methods for the standard <a href="https://doc.rust-lang.org/std/net/struct.UdpSocket.html"><code>UdpSocket</code> type</a> in <code>std::net</code>.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.set_recv_buffer_size' class='method'><code id='set_recv_buffer_size.v'>fn <a href='#tymethod.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>SO_RCVBUF</code> option on this socket.</p>
<p>Changes the size of the operating system's receive buffer associated with the socket.</p>
</div><h3 id='tymethod.recv_buffer_size' class='method'><code id='recv_buffer_size.v'>fn <a href='#tymethod.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVBUF</code> option on this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_recv_buffer_size"><code>set_recv_buffer_size</code></a>.</p>
</div><h3 id='tymethod.set_send_buffer_size' class='method'><code id='set_send_buffer_size.v'>fn <a href='#tymethod.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>SO_SNDBUF</code> option on this socket.</p>
<p>Changes the size of the operating system's send buffer associated with the socket.</p>
</div><h3 id='tymethod.send_buffer_size' class='method'><code id='send_buffer_size.v'>fn <a href='#tymethod.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDBUF</code> option on this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_send_buffer"><code>set_send_buffer</code></a>.</p>
</div><h3 id='tymethod.set_broadcast' class='method'><code id='set_broadcast.v'>fn <a href='#tymethod.set_broadcast' class='fnname'>set_broadcast</a>(&amp;self, broadcast: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>SO_BROADCAST</code> option for this socket.</p>
<p>When enabled, this socket is allowed to send packets to a broadcast
address.</p>
</div><h3 id='tymethod.broadcast' class='method'><code id='broadcast.v'>fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_BROADCAST</code> option for this socket.</p>
<p>For more information about this option, see
<a href="#tymethod.set_broadcast"><code>set_broadcast</code></a>.</p>
</div><h3 id='tymethod.set_multicast_loop_v4' class='method'><code id='set_multicast_loop_v4.v'>fn <a href='#tymethod.set_multicast_loop_v4' class='fnname'>set_multicast_loop_v4</a>(&amp;self, multicast_loop_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>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><h3 id='tymethod.multicast_loop_v4' class='method'><code id='multicast_loop_v4.v'>fn <a href='#tymethod.multicast_loop_v4' class='fnname'>multicast_loop_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IP_MULTICAST_LOOP</code> option for this socket.</p>
<p>For more information about this option, see
<a href="#tymethod.set_multicast_loop_v4"><code>set_multicast_loop_v4</code></a>.</p>
</div><h3 id='tymethod.set_multicast_ttl_v4' class='method'><code id='set_multicast_ttl_v4.v'>fn <a href='#tymethod.set_multicast_ttl_v4' class='fnname'>set_multicast_ttl_v4</a>(&amp;self, multicast_ttl_v4: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value 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><h3 id='tymethod.multicast_ttl_v4' class='method'><code id='multicast_ttl_v4.v'>fn <a href='#tymethod.multicast_ttl_v4' class='fnname'>multicast_ttl_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IP_MULTICAST_TTL</code> option for this socket.</p>
<p>For more information about this option, see
<a href="#tymethod.set_multicast_ttl_v4"><code>set_multicast_ttl_v4</code></a>.</p>
</div><h3 id='tymethod.set_multicast_hops_v6' class='method'><code id='set_multicast_hops_v6.v'>fn <a href='#tymethod.set_multicast_hops_v6' class='fnname'>set_multicast_hops_v6</a>(&amp;self, hops: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>IPV6_MULTICAST_HOPS</code> option for this socket</p>
</div><h3 id='tymethod.multicast_hops_v6' class='method'><code id='multicast_hops_v6.v'>fn <a href='#tymethod.multicast_hops_v6' class='fnname'>multicast_hops_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IPV6_MULTICAST_HOPS</code> option for this socket</p>
</div><h3 id='tymethod.set_multicast_loop_v6' class='method'><code id='set_multicast_loop_v6.v'>fn <a href='#tymethod.set_multicast_loop_v6' class='fnname'>set_multicast_loop_v6</a>(&amp;self, multicast_loop_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value 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><h3 id='tymethod.multicast_loop_v6' class='method'><code id='multicast_loop_v6.v'>fn <a href='#tymethod.multicast_loop_v6' class='fnname'>multicast_loop_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IPV6_MULTICAST_LOOP</code> option for this socket.</p>
<p>For more information about this option, see
<a href="#tymethod.set_multicast_loop_v6"><code>set_multicast_loop_v6</code></a>.</p>
</div><h3 id='tymethod.set_multicast_if_v4' class='method'><code id='set_multicast_if_v4.v'>fn <a href='#tymethod.set_multicast_if_v4' class='fnname'>set_multicast_if_v4</a>(&amp;self, interface: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>IP_MULTICAST_IF</code> option for this socket.</p>
<p>Specifies the interface to use for routing multicast packets.</p>
</div><h3 id='tymethod.multicast_if_v4' class='method'><code id='multicast_if_v4.v'>fn <a href='#tymethod.multicast_if_v4' class='fnname'>multicast_if_v4</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv4Addr.html" title="struct std::net::ip::Ipv4Addr">Ipv4Addr</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IP_MULTICAST_IF</code> option for this socket.</p>
<p>Returns the interface to use for routing multicast packets.</p>
</div><h3 id='tymethod.set_multicast_if_v6' class='method'><code id='set_multicast_if_v6.v'>fn <a href='#tymethod.set_multicast_if_v6' class='fnname'>set_multicast_if_v6</a>(&amp;self, interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value of the <code>IPV6_MULTICAST_IF</code> option for this socket.</p>
<p>Specifies the interface to use for routing multicast packets.</p>
</div><h3 id='tymethod.multicast_if_v6' class='method'><code id='multicast_if_v6.v'>fn <a href='#tymethod.multicast_if_v6' class='fnname'>multicast_if_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IPV6_MULTICAST_IF</code> option for this socket.</p>
<p>Returns the interface to use for routing multicast packets.</p>
</div><h3 id='tymethod.set_ttl' class='method'><code id='set_ttl.v'>fn <a href='#tymethod.set_ttl' class='fnname'>set_ttl</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value for the <code>IP_TTL</code> option on this socket.</p>
<p>This is the same as <a href="trait.TcpStreamExt.html#tymethod.set_ttl"><code>TcpStreamExt::set_ttl</code></a>.</p>
</div><h3 id='tymethod.ttl' class='method'><code id='ttl.v'>fn <a href='#tymethod.ttl' class='fnname'>ttl</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IP_TTL</code> option for this socket.</p>
<p>For more information about this option, see
<a href="trait.TcpStreamExt.html#tymethod.set_ttl"><code>TcpStreamExt::set_ttl</code></a>.</p>
</div><h3 id='tymethod.set_unicast_hops_v6' class='method'><code id='set_unicast_hops_v6.v'>fn <a href='#tymethod.set_unicast_hops_v6' class='fnname'>set_unicast_hops_v6</a>(&amp;self, ttl: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value for the <code>IPV6_UNICAST_HOPS</code> option on this socket.</p>
<p>Specifies the hop limit for ipv6 unicast packets</p>
</div><h3 id='tymethod.unicast_hops_v6' class='method'><code id='unicast_hops_v6.v'>fn <a href='#tymethod.unicast_hops_v6' class='fnname'>unicast_hops_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</code></h3><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><h3 id='tymethod.set_only_v6' class='method'><code id='set_only_v6.v'>fn <a href='#tymethod.set_only_v6' class='fnname'>set_only_v6</a>(&amp;self, only_v6: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the value for the <code>IPV6_V6ONLY</code> option on this socket.</p>
<p>For more information about this option, see
<a href="trait.TcpStreamExt.html#tymethod.set_only_v6"><code>TcpStreamExt::set_only_v6</code></a>.</p>
</div><h3 id='tymethod.only_v6' class='method'><code id='only_v6.v'>fn <a href='#tymethod.only_v6' class='fnname'>only_v6</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>IPV6_V6ONLY</code> option for this socket.</p>
<p>For more information about this option, see
<a href="trait.TcpStreamExt.html#tymethod.set_only_v6"><code>TcpStreamExt::set_only_v6</code></a>.</p>
</div><h3 id='tymethod.join_multicast_v4' class='method'><code id='join_multicast_v4.v'>fn <a href='#tymethod.join_multicast_v4' class='fnname'>join_multicast_v4</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;interface: &amp;<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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Executes 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><h3 id='tymethod.join_multicast_v6' class='method'><code id='join_multicast_v6.v'>fn <a href='#tymethod.join_multicast_v6' class='fnname'>join_multicast_v6</a>(&amp;self, multiaddr: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv6Addr.html" title="struct std::net::ip::Ipv6Addr">Ipv6Addr</a>, interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>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><h3 id='tymethod.leave_multicast_v4' class='method'><code id='leave_multicast_v4.v'>fn <a href='#tymethod.leave_multicast_v4' class='fnname'>leave_multicast_v4</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;multiaddr: &amp;<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>&nbsp;&nbsp;&nbsp;&nbsp;interface: &amp;<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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Executes an operation of the <code>IP_DROP_MEMBERSHIP</code> type.</p>
<p>For more information about this option, see
<a href="#tymethod.join_multicast_v4"><code>join_multicast_v4</code></a>.</p>
</div><h3 id='tymethod.leave_multicast_v6' class='method'><code id='leave_multicast_v6.v'>fn <a href='#tymethod.leave_multicast_v6' class='fnname'>leave_multicast_v6</a>(&amp;self, multiaddr: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/std/net/ip/struct.Ipv6Addr.html" title="struct std::net::ip::Ipv6Addr">Ipv6Addr</a>, interface: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Executes an operation of the <code>IPV6_DROP_MEMBERSHIP</code> type.</p>
<p>For more information about this option, see
<a href="#tymethod.join_multicast_v6"><code>join_multicast_v6</code></a>.</p>
</div><h3 id='tymethod.set_read_timeout_ms' class='method'><code id='set_read_timeout_ms.v'>fn <a href='#tymethod.set_read_timeout_ms' class='fnname'>set_read_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout, in milliseconds, of how long calls to
this socket's <code>read</code> function will wait before returning a timeout. A
value of <code>None</code> means that no read timeout should be specified and
otherwise <code>Some</code> indicates the number of milliseconds for the timeout.</p>
</div><h3 id='tymethod.set_read_timeout' class='method'><code id='set_read_timeout.v'>fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout of how long calls to this socket's
<code>read</code> function will wait before returning a timeout. A value of <code>None</code>
means that no read timeout should be specified and otherwise <code>Some</code>
indicates the number of duration of the timeout.</p>
</div><h3 id='tymethod.read_timeout_ms' class='method'><code id='read_timeout_ms.v'>fn <a href='#tymethod.read_timeout_ms' class='fnname'>read_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_read_timeout_ms"><code>set_read_timeout_ms</code></a>.</p>
</div><h3 id='tymethod.read_timeout' class='method'><code id='read_timeout.v'>fn <a href='#tymethod.read_timeout' class='fnname'>read_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_RCVTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_read_timeout"><code>set_read_timeout</code></a>.</p>
</div><h3 id='tymethod.set_write_timeout_ms' class='method'><code id='set_write_timeout_ms.v'>fn <a href='#tymethod.set_write_timeout_ms' class='fnname'>set_write_timeout_ms</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout, in milliseconds, of how long calls to
this socket's <code>write</code> function will wait before returning a timeout. A
value of <code>None</code> means that no read timeout should be specified and
otherwise <code>Some</code> indicates the number of milliseconds for the timeout.</p>
</div><h3 id='tymethod.set_write_timeout' class='method'><code id='set_write_timeout.v'>fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&amp;self, val: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Sets the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>This option specifies the timeout of how long calls to this socket's
<code>write</code> function will wait before returning a timeout. A value of <code>None</code>
means that no read timeout should be specified and otherwise <code>Some</code>
indicates the duration of the timeout.</p>
</div><h3 id='tymethod.write_timeout_ms' class='method'><code id='write_timeout_ms.v'>fn <a href='#tymethod.write_timeout_ms' class='fnname'>write_timeout_ms</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_write_timeout_ms"><code>set_write_timeout_ms</code></a>.</p>
</div><h3 id='tymethod.write_timeout' class='method'><code id='write_timeout.v'>fn <a href='#tymethod.write_timeout' class='fnname'>write_timeout</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;&gt;</code></h3><div class='docblock'><p>Gets the value of the <code>SO_SNDTIMEO</code> option for this socket.</p>
<p>For more information about this option, see <a href="#tymethod.set_write_timeout"><code>set_write_timeout</code></a>.</p>
</div><h3 id='tymethod.take_error' class='method'><code id='take_error.v'>fn <a href='#tymethod.take_error' class='fnname'>take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</code></h3><div class='docblock'><p>Get the value of the <code>SO_ERROR</code> option on this socket.</p>
<p>This will retrieve the stored error in the underlying socket, clearing
the field in the process. This can be useful for checking errors between
calls.</p>
</div><h3 id='tymethod.connect' class='method'><code id='connect.v'>fn <a href='#tymethod.connect' class='fnname'>connect</a>&lt;A:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(&amp;self, addr: A) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Connects this UDP socket to a remote address, allowing the <code>send</code> and
<code>recv</code> syscalls to be used to send data and also applies filters to only
receive data from the specified address.</p>
</div><h3 id='tymethod.send' class='method'><code id='send.v'>fn <a href='#tymethod.send' class='fnname'>send</a>(&amp;self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Sends data on the socket to the remote address to which it is connected.</p>
<p>The <code>connect</code> method will connect this socket to a remote address. This
method will fail if the socket is not connected.</p>
</div><h3 id='tymethod.recv' class='method'><code id='recv.v'>fn <a href='#tymethod.recv' class='fnname'>recv</a>(&amp;self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code></h3><div class='docblock'><p>Receives data on the socket from the remote address to which it is
connected.</p>
<p>The <code>connect</code> method will connect this socket to a remote address. This
method will fail if the socket is not connected.</p>
</div><h3 id='tymethod.set_nonblocking' class='method'><code id='set_nonblocking.v'>fn <a href='#tymethod.set_nonblocking' class='fnname'>set_nonblocking</a>(&amp;self, nonblocking: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></h3><div class='docblock'><p>Moves this UDP socket into or out of nonblocking mode.</p>
<p>For more information about this option, see
<a href="trait.TcpStreamExt.html#tymethod.set_nonblocking"><code>TcpStreamExt::set_nonblocking</code></a>.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-UdpSocketExt-for-UdpSocket' class='impl'><code class='in-band'>impl <a class="trait" href="../net2/trait.UdpSocketExt.html" title="trait net2::UdpSocketExt">UdpSocketExt</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-UdpSocketExt-for-UdpSocket' class='anchor'></a><a class='srclink' href='../src/net2/ext.rs.html#970-1235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_recv_buffer_size' class="method hidden"><code id='set_recv_buffer_size.v-1'>fn <a href='#method.set_recv_buffer_size' class='fnname'>set_recv_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#972-974' title='goto source code'>[src]</a></h4><h4 id='method.recv_buffer_size' class="method hidden"><code id='recv_buffer_size.v-1'>fn <a href='#method.recv_buffer_size' class='fnname'>recv_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#976-978' title='goto source code'>[src]</a></h4><h4 id='method.set_send_buffer_size' class="method hidden"><code id='set_send_buffer_size.v-1'>fn <a href='#method.set_send_buffer_size' class='fnname'>set_send_buffer_size</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#980-982' title='goto source code'>[src]</a></h4><h4 id='method.send_buffer_size' class="method hidden"><code id='send_buffer_size.v-1'>fn <a href='#method.send_buffer_size' class='fnname'>send_buffer_size</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#984-986' title='goto source code'>[src]</a></h4><h4 id='method.set_broadcast' class="method hidden"><code id='set_broadcast.v-1'>fn <a href='#method.set_broadcast' class='fnname'>set_broadcast</a>(&amp;self, broadcast: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#988-991' title='goto source code'>[src]</a></h4><h4 id='method.broadcast' class="method hidden"><code id='broadcast.v-1'>fn <a href='#method.broadcast' class='fnname'>broadcast</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code><a class='srclink' href='../src/net2/ext.rs.html#992-995' title='goto source code'>[src]</a></h4><h4 id='method.
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/net2/trait.UdpSocketExt.js">
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "net2";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>