mentat/tokio_proto/trait.BindServer.html

173 lines
18 KiB
HTML
Raw Permalink Normal View History

2018-08-22 17:04:13 +00:00
<!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 `BindServer` trait in crate `tokio_proto`.">
<meta name="keywords" content="rust, rustlang, rust-lang, BindServer">
<title>tokio_proto::BindServer - 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">&#9776;</div>
<p class='location'>Trait BindServer</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></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.bind_server">bind_server</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: 'BindServer', 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=''>BindServer</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/tokio_proto/lib.rs.html#227-245' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait BindServer&lt;Kind, T:&nbsp;'static&gt;: '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>;
fn <a href='#tymethod.bind_server' class='fnname'>bind_server</a>&lt;S&gt;(&amp;self, handle: &amp;<a class="struct" href="../tokio_core/reactor/struct.Handle.html" title="struct tokio_core::reactor::Handle">Handle</a>, io: T, service: S)<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../tokio_service/trait.Service.html" title="trait tokio_service::Service">Service</a>&lt;Request = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceRequest" title="type tokio_proto::BindServer::ServiceRequest">ServiceRequest</a>, Response = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceResponse" title="type tokio_proto::BindServer::ServiceResponse">ServiceResponse</a>, Error = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceError" title="type tokio_proto::BindServer::ServiceError">ServiceError</a>&gt; + 'static</span>;
}</pre><div class='docblock'><p>Binds a service to an I/O object.</p>
<p>This trait is not intended to be implemented directly; instead, implement
one of the server protocol traits:</p>
<ul>
<li><code>pipeline::ServerProto</code></li>
<li><code>multiplex::ServerProto</code></li>
<li><code>streaming::pipeline::ServerProto</code></li>
<li><code>streaming::multiplex::ServerProto</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></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_server' class='method'><span id='bind_server.v' class='invisible'><code>fn <a href='#tymethod.bind_server' class='fnname'>bind_server</a>&lt;S&gt;(&amp;self, handle: &amp;<a class="struct" href="../tokio_core/reactor/struct.Handle.html" title="struct tokio_core::reactor::Handle">Handle</a>, io: T, service: S) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../tokio_service/trait.Service.html" title="trait tokio_service::Service">Service</a>&lt;Request = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceRequest" title="type tokio_proto::BindServer::ServiceRequest">ServiceRequest</a>, Response = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceResponse" title="type tokio_proto::BindServer::ServiceResponse">ServiceResponse</a>, Error = Self::<a class="type" href="../tokio_proto/trait.BindServer.html#associatedtype.ServiceError" title="type tokio_proto::BindServer::ServiceError">ServiceError</a>&gt; + 'static,&nbsp;</span></code></span></h3><div class='docblock'><p>Bind the service.</p>
<p>This method should spawn a new task on the given event loop handle which
provides the given service on the given I/O object.</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/server.rs.html#55-69' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;'static, P:&nbsp;<a class="trait" href="../tokio_proto/pipeline/trait.ServerProto.html" title="trait tokio_proto::pipeline::ServerProto">ServerProto</a>&lt;T&gt;&gt; BindServer&lt;<a class="struct" href="../tokio_proto/pipeline/struct.Pipeline.html" title="struct tokio_proto::pipeline::Pipeline">Pipeline</a>, T&gt; 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.ServerProto.html#associatedtype.Request" title="type tokio_proto::pipeline::ServerProto::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.ServerProto.html#associatedtype.Response" title="type tokio_proto::pipeline::ServerProto::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></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/simple/multiplex/server.rs.html#55-69' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;'static, P:&nbsp;<a class="trait" href="../tokio_proto/multiplex/trait.ServerProto.html" title="trait tokio_proto::multiplex::ServerProto">ServerProto</a>&lt;T&gt;&gt; BindServer&lt;<a class="struct" href="../tokio_proto/multiplex/struct.Multiplex.html" title="struct tokio_proto::multiplex::Multiplex">Multiplex</a>, T&gt; 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.ServerProto.html#associatedtype.Request" title="type tokio_proto::multiplex::ServerProto::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.ServerProto.html#associatedtype.Response" title="type tokio_proto::multiplex::ServerProto::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></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/streaming/pipeline/server.rs.html#56-82' title='goto source code'>[src]</a></div><code>impl&lt;P, T, B&gt; BindServer&lt;<a class="struct" href="../tokio_proto/streaming/pipeline/struct.StreamingPipeline.html" title="struct tokio_proto::streaming::pipeline::StreamingPipeline">StreamingPipeline</a>&lt;B&gt;, T&gt; for P <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html" title="trait tokio_proto::streaming::pipeline::ServerProto">ServerProto</a>&lt;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.ResponseBody" title="type tokio_proto::streaming::pipeline::ServerProto::ResponseBody">ResponseBody</a>, Error = P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ServerProto::Error">Error</a>&gt;,&nbsp;</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>&lt;P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.Request" title="type tokio_proto::streaming::pipeline::ServerProto::Request">Request</a>, <a class="struct" href="../tokio_proto/streaming/struct.Body.html" title="struct tokio_proto::streaming::Body">Body</a>&lt;P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.RequestBody" title="type tokio_proto::streaming::pipeline::ServerProto::RequestBody">RequestBody</a>, P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ServerProto::Error">Error</a>&gt;&gt;;</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>&lt;P::<a class="type" href="../tokio_proto/streaming/pipeline/trait.ServerProto.html#associatedtype.Response" title="type tokio_proto::streaming::pipeline::ServerProto::Response">Response</a>, B&gt;;</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.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::pipeline::ServerProto::Error">Error</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/tokio_proto/streaming/multiplex/server.rs.html#70-96' title='goto source code'>[src]</a></div><code>impl&lt;P, T, B&gt; BindServer&lt;<a class="struct" href="../tokio_proto/streaming/multiplex/struct.StreamingMultiplex.html" title="struct tokio_proto::streaming::multiplex::StreamingMultiplex">StreamingMultiplex</a>&lt;B&gt;, T&gt; for P <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html" title="trait tokio_proto::streaming::multiplex::ServerProto">ServerProto</a>&lt;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.ResponseBody" title="type tokio_proto::streaming::multiplex::ServerProto::ResponseBody">ResponseBody</a>, Error = P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ServerProto::Error">Error</a>&gt;,&nbsp;</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>&lt;P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.Request" title="type tokio_proto::streaming::multiplex::ServerProto::Request">Request</a>, <a class="struct" href="../tokio_proto/streaming/struct.Body.html" title="struct tokio_proto::streaming::Body">Body</a>&lt;P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.RequestBody" title="type tokio_proto::streaming::multiplex::ServerProto::RequestBody">RequestBody</a>, P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ServerProto::Error">Error</a>&gt;&gt;;</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>&lt;P::<a class="type" href="../tokio_proto/streaming/multiplex/trait.ServerProto.html#associatedtype.Response" title="type tokio_proto::streaming::multiplex::ServerProto::Response">Response</a>, B&gt;;</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.ServerProto.html#associatedtype.Error" title="type tokio_proto::streaming::multiplex::ServerProto::Error">Error</a>;</span></code></li>
</ul><script type="text/javascript" async
src="../implementors/tokio_proto/trait.BindServer.js">
</script></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt><kbd></kbd></dt>
<dd>Move up in search results</dd>
<dt><kbd></kbd></dt>
<dd>Move down in search results</dd>
<dt><kbd></kbd></dt>
<dd>Switch tab</dd>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "tokio_proto";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>