173 lines
21 KiB
HTML
173 lines
21 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 `BindClient` trait in crate `tokio_proto`.">
|
|||
|
<meta name="keywords" content="rust, rustlang, rust-lang, BindClient">
|
|||
|
|
|||
|
<title>tokio_proto::BindClient - Rust</title>
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../dark.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
|
|||
|
<script src="../storage.js"></script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</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">☰</div>
|
|||
|
|
|||
|
<p class='location'>Trait BindClient</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.ServiceRequest">ServiceRequest</a><a href="#associatedtype.ServiceResponse">ServiceResponse</a><a href="#associatedtype.ServiceError">ServiceError</a><a href="#associatedtype.BindClient">BindClient</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.bind_client">bind_client</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>tokio_proto</a></p><script>window.sidebarCurrent = {name: 'BindClient', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div class="theme-picker">
|
|||
|
<button id="theme-picker" aria-label="Pick another theme!">
|
|||
|
<img src="../brush.svg" width="18" alt="Pick another theme!">
|
|||
|
</button>
|
|||
|
<div id="theme-choices"></div>
|
|||
|
</div>
|
|||
|
<script src="../theme.js"></script>
|
|||
|
<nav class="sub">
|
|||
|
<form class="search-form js-only">
|
|||
|
<div class="search-container">
|
|||
|
<input class="search-input" name="search"
|
|||
|
autocomplete="off"
|
|||
|
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
|||
|
type="search">
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
</nav>
|
|||
|
|
|||
|
<section id='main' class="content">
|
|||
|
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>tokio_proto</a>::<wbr><a class="trait" href=''>BindClient</a></span><span class='out-of-band'><span id='render-detail'>
|
|||
|
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
|||
|
[<span class='inner'>−</span>]
|
|||
|
</a>
|
|||
|
</span><a class='srclink' href='../src/tokio_proto/lib.rs.html#263-280' title='goto source code'>[src]</a></span></h1>
|
|||
|
<pre class='rust trait'>pub trait BindClient<Kind, T: 'static>: 'static {
|
|||
|
type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a>;
|
|||
|
type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a>;
|
|||
|
type <a href='#associatedtype.ServiceError' class="type">ServiceError</a>;
|
|||
|
type <a href='#associatedtype.BindClient' class="type">BindClient</a>: <a class="trait" href="../tokio_service/trait.Service.html" title="trait tokio_service::Service">Service</a><Request = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceRequest" title="type tokio_proto::BindClient::ServiceRequest">ServiceRequest</a>, Response = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceResponse" title="type tokio_proto::BindClient::ServiceResponse">ServiceResponse</a>, Error = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceError" title="type tokio_proto::BindClient::ServiceError">ServiceError</a>>;
|
|||
|
fn <a href='#tymethod.bind_client' class='fnname'>bind_client</a>(&self, handle: &<a class="struct" href="../tokio_core/reactor/struct.Handle.html" title="struct tokio_core::reactor::Handle">Handle</a>, io: T) -> Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.BindClient" title="type tokio_proto::BindClient::BindClient">BindClient</a>;
|
|||
|
}</pre><div class='docblock'><p>Binds an I/O object as a client of a service.</p>
|
|||
|
<p>This trait is not intended to be implemented directly; instead, implement
|
|||
|
one of the server protocol traits:</p>
|
|||
|
<ul>
|
|||
|
<li><code>pipeline::ClientProto</code></li>
|
|||
|
<li><code>multiplex::ClientProto</code></li>
|
|||
|
<li><code>streaming::pipeline::ClientProto</code></li>
|
|||
|
<li><code>streaming::multiplex::ClientProto</code></li>
|
|||
|
</ul>
|
|||
|
<p>See the crate documentation for more details on those traits.</p>
|
|||
|
<p>The <code>Kind</code> parameter, in particular, is a zero-sized type used to allow
|
|||
|
blanket implementation from the various protocol traits. Any additional
|
|||
|
implementations of this trait should use their own zero-sized kind type to
|
|||
|
distinguish them.</p>
|
|||
|
</div>
|
|||
|
<h2 id='associated-types' class='small-section-header'>
|
|||
|
Associated Types<a href='#associated-types' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<div class='methods'>
|
|||
|
<h3 id='associatedtype.ServiceRequest' class='method'><span id='ServiceRequest.t' class='invisible'><code>type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a></code></span></h3><div class='docblock'><p>The request type for the service.</p>
|
|||
|
</div><h3 id='associatedtype.ServiceResponse' class='method'><span id='ServiceResponse.t' class='invisible'><code>type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a></code></span></h3><div class='docblock'><p>The response type for the service.</p>
|
|||
|
</div><h3 id='associatedtype.ServiceError' class='method'><span id='ServiceError.t' class='invisible'><code>type <a href='#associatedtype.ServiceError' class="type">ServiceError</a></code></span></h3><div class='docblock'><p>The error type for the service.</p>
|
|||
|
</div><h3 id='associatedtype.BindClient' class='method'><span id='BindClient.t' class='invisible'><code>type <a href='#associatedtype.BindClient' class="type">BindClient</a>: <a class="trait" href="../tokio_service/trait.Service.html" title="trait tokio_service::Service">Service</a><Request = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceRequest" title="type tokio_proto::BindClient::ServiceRequest">ServiceRequest</a>, Response = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceResponse" title="type tokio_proto::BindClient::ServiceResponse">ServiceResponse</a>, Error = Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceError" title="type tokio_proto::BindClient::ServiceError">ServiceError</a>></code></span></h3><div class='docblock'><p>The bound service.</p>
|
|||
|
</div></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.bind_client' class='method'><span id='bind_client.v' class='invisible'><code>fn <a href='#tymethod.bind_client' class='fnname'>bind_client</a>(&self, handle: &<a class="struct" href="../tokio_core/reactor/struct.Handle.html" title="struct tokio_core::reactor::Handle">Handle</a>, io: T) -> Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.BindClient" title="type tokio_proto::BindClient::BindClient">BindClient</a></code></span></h3><div class='docblock'><p>Bind an I/O object as a service.</p>
|
|||
|
</div></div>
|
|||
|
<h2 id='implementors' class='small-section-header'>
|
|||
|
Implementors<a href='#implementors' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<ul class='item-list' id='implementors-list'>
|
|||
|
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/simple/pipeline/client.rs.html#53-67' title='goto source code'>[src]</a></div><code>impl<T: 'static, P: <a class="trait" href="../tokio_proto/pipeline/trait.ClientProto.html" title="trait tokio_proto::pipeline::ClientProto">ClientProto</a><T>> BindClient<<a class="struct" href="../tokio_proto/pipeline/struct.Pipeline.html" title="struct tokio_proto::pipeline::Pipeline">Pipeline</a>, T> for P<span class="where fmt-newline"> type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a> = P::<a class="type" href="../tokio_proto/pipeline/trait.ClientProto.html#associatedtype.Request" title="type tokio_proto::pipeline::ClientProto::Request">Request</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a> = P::<a class="type" href="../tokio_proto/pipeline/trait.ClientProto.html#associatedtype.Response" title="type tokio_proto::pipeline::ClientProto::Response">Response</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceError' class="type">ServiceError</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>;</span><span class="where fmt-newline"> type <a href='#associatedtype.BindClient' class="type">BindClient</a> = <a class="struct" href="../tokio_proto/pipeline/struct.ClientService.html" title="struct tokio_proto::pipeline::ClientService">ClientService</a><T, P>;</span></code></li>
|
|||
|
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/simple/multiplex/client.rs.html#54-68' title='goto source code'>[src]</a></div><code>impl<T: 'static, P: <a class="trait" href="../tokio_proto/multiplex/trait.ClientProto.html" title="trait tokio_proto::multiplex::ClientProto">ClientProto</a><T>> BindClient<<a class="struct" href="../tokio_proto/multiplex/struct.Multiplex.html" title="struct tokio_proto::multiplex::Multiplex">Multiplex</a>, T> for P<span class="where fmt-newline"> type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a> = P::<a class="type" href="../tokio_proto/multiplex/trait.ClientProto.html#associatedtype.Request" title="type tokio_proto::multiplex::ClientProto::Request">Request</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a> = P::<a class="type" href="../tokio_proto/multiplex/trait.ClientProto.html#associatedtype.Response" title="type tokio_proto::multiplex::ClientProto::Response">Response</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceError' class="type">ServiceError</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>;</span><span class="where fmt-newline"> type <a href='#associatedtype.BindClient' class="type">BindClient</a> = <a class="struct" href="../tokio_proto/multiplex/struct.ClientService.html" title="struct tokio_proto::multiplex::ClientService">ClientService</a><T, P>;</span></code></li>
|
|||
|
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/streaming/pipeline/client.rs.html#51-83' title='goto source code'>[src]</a></div><code>impl<P, T, B> BindClient<<a class="struct" href="../tokio_proto/streaming/pipeline/struct.StreamingPipeline.html" title="struct tokio_proto::streaming::pipeline::StreamingPipeline">StreamingPipeline</a><B>, T> for P <span class="where fmt-newline">where<br> P: <a class="trait" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html" title="trait tokio_proto::streaming::pipeline::ClientProto">ClientProto</a><T>,<br> T: 'static,<br> B: <a class="trait" href="../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.RequestBody" title="type tokio_proto::streaming::pipeline::ClientProto::RequestBody">RequestBody</a>, Error = P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ClientProto::Error">Error</a>> + 'static, </span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a> = <a class="enum" href="../tokio_proto/streaming/enum.Message.html" title="enum tokio_proto::streaming::Message">Message</a><P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.Request" title="type tokio_proto::streaming::pipeline::ClientProto::Request">Request</a>, B>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a> = <a class="enum" href="../tokio_proto/streaming/enum.Message.html" title="enum tokio_proto::streaming::Message">Message</a><P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.Response" title="type tokio_proto::streaming::pipeline::ClientProto::Response">Response</a>, <a class="struct" href="../tokio_proto/streaming/struct.Body.html" title="struct tokio_proto::streaming::Body">Body</a><P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.ResponseBody" title="type tokio_proto::streaming::pipeline::ClientProto::ResponseBody">ResponseBody</a>, P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ClientProto::Error">Error</a>>>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceError' class="type">ServiceError</a> = P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ClientProto::Error">Error</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.BindClient' class="type">BindClient</a> = <a class="struct" href="../tokio_proto/util/client_proxy/struct.ClientProxy.html" title="struct tokio_proto::util::client_proxy::ClientProxy">ClientProxy</a><Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceRequest" title="type tokio_proto::BindClient::ServiceRequest">ServiceRequest</a>, Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceResponse" title="type tokio_proto::BindClient::ServiceResponse">ServiceResponse</a>, Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceError" title="type tokio_proto::BindClient::ServiceError">ServiceError</a>>;</span></code></li>
|
|||
|
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/streaming/multiplex/client.rs.html#53-86' title='goto source code'>[src]</a></div><code>impl<P, T, B> BindClient<<a class="struct" href="../tokio_proto/streaming/multiplex/struct.StreamingMultiplex.html" title="struct tokio_proto::streaming::multiplex::StreamingMultiplex">StreamingMultiplex</a><B>, T> for P <span class="where fmt-newline">where<br> P: <a class="trait" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html" title="trait tokio_proto::streaming::multiplex::ClientProto">ClientProto</a><T>,<br> T: 'static,<br> B: <a class="trait" href="../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.RequestBody" title="type tokio_proto::streaming::multiplex::ClientProto::RequestBody">RequestBody</a>, Error = P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ClientProto::Error">Error</a>> + 'static, </span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceRequest' class="type">ServiceRequest</a> = <a class="enum" href="../tokio_proto/streaming/enum.Message.html" title="enum tokio_proto::streaming::Message">Message</a><P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.Request" title="type tokio_proto::streaming::multiplex::ClientProto::Request">Request</a>, B>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceResponse' class="type">ServiceResponse</a> = <a class="enum" href="../tokio_proto/streaming/enum.Message.html" title="enum tokio_proto::streaming::Message">Message</a><P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.Response" title="type tokio_proto::streaming::multiplex::ClientProto::Response">Response</a>, <a class="struct" href="../tokio_proto/streaming/struct.Body.html" title="struct tokio_proto::streaming::Body">Body</a><P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.ResponseBody" title="type tokio_proto::streaming::multiplex::ClientProto::ResponseBody">ResponseBody</a>, P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ClientProto::Error">Error</a>>>;</span><span class="where fmt-newline"> type <a href='#associatedtype.ServiceError' class="type">ServiceError</a> = P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ClientProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ClientProto::Error">Error</a>;</span><span class="where fmt-newline"> type <a href='#associatedtype.BindClient' class="type">BindClient</a> = <a class="struct" href="../tokio_proto/util/client_proxy/struct.ClientProxy.html" title="struct tokio_proto::util::client_proxy::ClientProxy">ClientProxy</a><Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceRequest" title="type tokio_proto::BindClient::ServiceRequest">ServiceRequest</a>, Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceResponse" title="type tokio_proto::BindClient::ServiceResponse">ServiceResponse</a>, Self::<a class="type" href="../tokio_proto/trait.BindClient.html#associatedtype.ServiceError" title="type tokio_proto::BindClient::ServiceError">ServiceError</a>>;</span></code></li>
|
|||
|
</ul><script type="text/javascript" async
|
|||
|
src="../implementors/tokio_proto/trait.BindClient.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>⏎</kbd></dt>
|
|||
|
<dd>Go to active search result</dd>
|
|||
|
<dt><kbd>+</kbd></dt>
|
|||
|
<dd>Expand all sections</dd>
|
|||
|
<dt><kbd>-</kbd></dt>
|
|||
|
<dd>Collapse all sections</dd>
|
|||
|
</dl>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="infos">
|
|||
|
<h2>Search Tricks</h2>
|
|||
|
|
|||
|
<p>
|
|||
|
Prefix searches with a type followed by a colon (e.g.
|
|||
|
<code>fn:</code>) to restrict the search to a given type.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Accepted types are: <code>fn</code>, <code>mod</code>,
|
|||
|
<code>struct</code>, <code>enum</code>,
|
|||
|
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
|||
|
and <code>const</code>.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Search functions by type signature (e.g.
|
|||
|
<code>vec -> usize</code> or <code>* -> vec</code>)
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</aside>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
window.rootPath = "../";
|
|||
|
window.currentCrate = "tokio_proto";
|
|||
|
</script>
|
|||
|
<script src="../main.js"></script>
|
|||
|
<script defer src="../search-index.js"></script>
|
|||
|
</body>
|
|||
|
</html>
|