<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/bdk/blockchain/compact_filters/peer.rs.html#94-105" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">blockchain</a>::<wbr><a href="index.html">compact_filters</a>::<wbr><a class="struct" href="">Peer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Peer { /* fields omitted */ }</pre></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>A Bitcoin peer</p>
</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="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/peer.rs.html#107-387" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.connect" class="method"><code>pub fn <a href="#method.connect" class="fnname">connect</a><A: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> address: A, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/peer.rs.html#112-120" title="goto source code">[src]</a></h4><div class="docblock"><p>Connect to a peer over a plaintext TCP connection</p>
<p>This function internally spawns a new thread that will monitor incoming messages from the
-peer, and optionally reply to some of them transparently, like <a href="NetworkMessage::Ping">pings</a></p>
+peer, and optionally reply to some of them transparently, like <a href="bitcoin::network::message::NetworkMessage::Ping">pings</a></p>
</div><h4 id="method.connect_proxy" class="method"><code>pub fn <a href="#method.connect_proxy" class="fnname">connect_proxy</a><T: <a class="trait" href="https://docs.rs/socks/0.3.0/socks/trait.ToTargetAddr.html" title="trait socks::ToTargetAddr">ToTargetAddr</a>, P: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> target: T, <br> proxy: P, <br> credentials: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</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.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/peer.rs.html#127-141" title="goto source code">[src]</a></h4><div class="docblock"><p>Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified
as a tuple of <code>(username, password)</code></p>
<p>This function internally spawns a new thread that will monitor incoming messages from the
section, we will take a brief tour of BDK, summarizing the major APIs and
their uses.</p>
<p>The easiest way to get started is to add bdk to your dependencies with the default features.
-The default features include a simple key-value database (<a href="crate::sled"><code>sled</code></a>) to cache
+The default features include a simple key-value database (<a href="sled"><code>sled</code></a>) to cache
blockchain data and an <a href="https://docs.rs/electrum-client/">electrum</a> blockchain client to
interact with the bitcoin P2P network.</p>
<pre><code class="language-toml">bdk = "0.2.0"
<span class="doccomment">/// Connect to a peer over a plaintext TCP connection</span>
<span class="doccomment">///</span>
<span class="doccomment">/// This function internally spawns a new thread that will monitor incoming messages from the</span>
- <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](NetworkMessage::Ping)</span>
+ <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](bitcoin::network::message::NetworkMessage::Ping)</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">connect</span><span class="op"><</span><span class="ident">A</span>: <span class="ident">ToSocketAddrs</span><span class="op">></span>(
<span class="ident">address</span>: <span class="ident">A</span>,
<span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
<span class="doccomment">//! their uses.</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! The easiest way to get started is to add bdk to your dependencies with the default features.</span>
-<span class="doccomment">//! The default features include a simple key-value database ([`sled`](crate::sled)) to cache</span>
+<span class="doccomment">//! The default features include a simple key-value database ([`sled`](sled)) to cache</span>
<span class="doccomment">//! blockchain data and an [electrum](https://docs.rs/electrum-client/) blockchain client to</span>
<span class="doccomment">//! interact with the bitcoin P2P network.</span>
<span class="doccomment">//!</span>