<!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 `ClientConnection` struct in crate `solicit`."> <meta name="keywords" content="rust, rustlang, rust-lang, ClientConnection"> <title>solicit::http::client::ClientConnection - Rust</title> <link rel="stylesheet" type="text/css" href="../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../../index.html'>solicit</a>::<wbr><a href='../index.html'>http</a>::<wbr><a href='index.html'>client</a></p><script>window.sidebarCurrent = {name: 'ClientConnection', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <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 struct"> <h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>solicit</a>::<wbr><a href='../index.html'>http</a>::<wbr><a href='index.html'>client</a>::<wbr><a class='struct' href=''>ClientConnection</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 id='src-1327' class='srclink' href='../../../src/solicit/http/client/mod.rs.html#176-184' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct ClientConnection<S, R, State = <a class='struct' href='../../../solicit/http/session/struct.DefaultSessionState.html' title='solicit::http::session::DefaultSessionState'>DefaultSessionState</a><<a class='struct' href='../../../solicit/http/session/struct.DefaultStream.html' title='solicit::http::session::DefaultStream'>DefaultStream</a>>> <span class='where'>where S: <a class='trait' href='../../../solicit/http/connection/trait.SendFrame.html' title='solicit::http::connection::SendFrame'>SendFrame</a>, R: <a class='trait' href='../../../solicit/http/connection/trait.ReceiveFrame.html' title='solicit::http::connection::ReceiveFrame'>ReceiveFrame</a>, State: <a class='trait' href='../../../solicit/http/session/trait.SessionState.html' title='solicit::http::session::SessionState'>SessionState</a></span> { pub state: State, // some fields omitted }</pre><div class='docblock'><p>The struct extends the <code>HttpConnection</code> API with client-specific methods (such as <code>start_request</code>) and wires the <code>HttpConnection</code> to the client <code>Session</code> callbacks.</p> </div><h2 class='fields'>Fields</h2><span id='structfield.state' class='structfield'><code>state: State</code> </span><span class='stab '></span><div class='docblock'><p>The state of the session associated to this client connection. Maintains the status of the connection streams.</p> </div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl<S, R, State> <a class='struct' href='../../../solicit/http/client/struct.ClientConnection.html' title='solicit::http::client::ClientConnection'>ClientConnection</a><S, R, State> <span class='where'>where S: <a class='trait' href='../../../solicit/http/connection/trait.SendFrame.html' title='solicit::http::connection::SendFrame'>SendFrame</a>, R: <a class='trait' href='../../../solicit/http/connection/trait.ReceiveFrame.html' title='solicit::http::connection::ReceiveFrame'>ReceiveFrame</a>, State: <a class='trait' href='../../../solicit/http/session/trait.SessionState.html' title='solicit::http::session::SessionState'>SessionState</a></span></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1333' class='srclink' href='../../../src/solicit/http/client/mod.rs.html#186-265' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.with_connection' class='method'><code>fn <a href='#method.with_connection' class='fnname'>with_connection</a>(conn: <a class='struct' href='../../../solicit/http/connection/struct.HttpConnection.html' title='solicit::http::connection::HttpConnection'>HttpConnection</a><S, R>, state: State) -> <a class='struct' href='../../../solicit/http/client/struct.ClientConnection.html' title='solicit::http::client::ClientConnection'>ClientConnection</a><S, R, State></code></h4> <div class='docblock'><p>Creates a new <code>ClientConnection</code> that will use the given <code>HttpConnection</code> for all its underlying HTTP/2 communication.</p> <p>The given <code>state</code> instance will handle the maintenance of the session's state.</p> </div><h4 id='method.scheme' class='method'><code>fn <a href='#method.scheme' class='fnname'>scheme</a>(&self) -> <a class='enum' href='../../../solicit/http/enum.HttpScheme.html' title='solicit::http::HttpScheme'>HttpScheme</a></code></h4> <div class='docblock'><p>Returns the scheme of the underlying <code>HttpConnection</code>.</p> </div><h4 id='method.init' class='method'><code>fn <a href='#method.init' class='fnname'>init</a>(&mut self) -> <a class='type' href='../../../solicit/http/type.HttpResult.html' title='solicit::http::HttpResult'>HttpResult</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h4> <div class='docblock'><p>Performs the initialization of the <code>ClientConnection</code>.</p> <p>This means that it expects the next frame that it receives to be the server preface -- i.e. a <code>SETTINGS</code> frame. Returns an <code>HttpError</code> if this is not the case.</p> </div><h4 id='method.start_request' class='method'><code>fn <a href='#method.start_request' class='fnname'>start_request</a>(&mut self, req: <a class='struct' href='../../../solicit/http/client/struct.RequestStream.html' title='solicit::http::client::RequestStream'>RequestStream</a><State::Stream>) -> <a class='type' href='../../../solicit/http/type.HttpResult.html' title='solicit::http::HttpResult'>HttpResult</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h4> <div class='docblock'><p>Starts a new request based on the given <code>RequestStream</code>.</p> <p>For now it does not perform any validation whether the given <code>RequestStream</code> is valid.</p> </div><h4 id='method.handle_next_frame' class='method'><code>fn <a href='#method.handle_next_frame' class='fnname'>handle_next_frame</a>(&mut self) -> <a class='type' href='../../../solicit/http/type.HttpResult.html' title='solicit::http::HttpResult'>HttpResult</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h4> <div class='docblock'><p>Fully handles the next incoming frame. Events are passed on to the internal <code>session</code> instance.</p> </div><h4 id='method.send_next_data' class='method'><code>fn <a href='#method.send_next_data' class='fnname'>send_next_data</a>(&mut self) -> <a class='type' href='../../../solicit/http/type.HttpResult.html' title='solicit::http::HttpResult'>HttpResult</a><<a class='enum' href='../../../solicit/http/connection/enum.SendStatus.html' title='solicit::http::connection::SendStatus'>SendStatus</a>></code></h4> <div class='docblock'><p>Queues a new DATA frame onto the underlying <code>SendFrame</code>.</p> <p>Currently, no prioritization of streams is taken into account and which stream's data is queued cannot be relied on.</p> </div></div></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>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>⇤</dt> <dd>Move up in search results</dd> <dt>⇥</dt> <dd>Move down in search results</dd> <dt>⏎</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand 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 = "solicit"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>