<!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 `DefaultSessionState` struct in crate `solicit`."> <meta name="keywords" content="rust, rustlang, rust-lang, DefaultSessionState"> <title>solicit::http::session::DefaultSessionState - 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'>session</a></p><script>window.sidebarCurrent = {name: 'DefaultSessionState', 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'>session</a>::<wbr><a class='struct' href=''>DefaultSessionState</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-1019' class='srclink' href='../../../src/solicit/http/session.rs.html#94-97' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct DefaultSessionState<S> <span class='where'>where S: <a class='trait' href='../../../solicit/http/session/trait.Stream.html' title='solicit::http::session::Stream'>Stream</a></span> { // some fields omitted }</pre><div class='docblock'><p>An implementation of the <code>SessionState</code> trait that tracks the active streams in a <code>HashMap</code>, mapping the stream ID to the concrete <code>Stream</code> instance.</p> </div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl<S> <a class='struct' href='../../../solicit/http/session/struct.DefaultSessionState.html' title='solicit::http::session::DefaultSessionState'>DefaultSessionState</a><S> <span class='where'>where S: <a class='trait' href='../../../solicit/http/session/trait.Stream.html' title='solicit::http::session::Stream'>Stream</a></span></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1022' class='srclink' href='../../../src/solicit/http/session.rs.html#99-106' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>() -> <a class='struct' href='../../../solicit/http/session/struct.DefaultSessionState.html' title='solicit::http::session::DefaultSessionState'>DefaultSessionState</a><S></code></h4> <div class='docblock'><p>Creates a new <code>DefaultSessionState</code> with no known streams.</p> </div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl<S> <a class='trait' href='../../../solicit/http/session/trait.SessionState.html' title='solicit::http::session::SessionState'>SessionState</a> for <a class='struct' href='../../../solicit/http/session/struct.DefaultSessionState.html' title='solicit::http::session::DefaultSessionState'>DefaultSessionState</a><S> <span class='where'>where S: <a class='trait' href='../../../solicit/http/session/trait.Stream.html' title='solicit::http::session::Stream'>Stream</a></span></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1025' class='srclink' href='../../../src/solicit/http/session.rs.html#108-134' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='associatedtype.Stream' class='type'><code>type <a href='../../../solicit/http/session/trait.SessionState.html#associatedtype.Stream' class='type'>Stream</a> = S</code></h4> <div class='docblock'><p>The type of the <code>Stream</code> that the <code>SessionState</code> manages.</p> </div><h4 id='method.insert_stream' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#tymethod.insert_stream' class='fnname'>insert_stream</a>(&mut self, stream: Self::Stream)</code></h4> <div class='docblock'><p>Inserts the given <code>Stream</code> into the session's state, starting to track it.</p> </div><h4 id='method.get_stream_ref' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#tymethod.get_stream_ref' class='fnname'>get_stream_ref</a>(&self, stream_id: <a class='type' href='../../../solicit/http/type.StreamId.html' title='solicit::http::StreamId'>StreamId</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&Self::Stream></code></h4> <div class='docblock'><p>Returns a reference to a <code>Stream</code> with the given <code>StreamId</code>, if it is found in the current session. <a href="../../../solicit/http/session/trait.SessionState.html#tymethod.get_stream_ref">Read more</a></p> </div><h4 id='method.get_stream_mut' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#tymethod.get_stream_mut' class='fnname'>get_stream_mut</a>(&mut self, stream_id: <a class='type' href='../../../solicit/http/type.StreamId.html' title='solicit::http::StreamId'>StreamId</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&mut Self::Stream></code></h4> <div class='docblock'><p>Returns a mutable reference to a <code>Stream</code> with the given <code>StreamId</code>, if it is found in the current session. <a href="../../../solicit/http/session/trait.SessionState.html#tymethod.get_stream_mut">Read more</a></p> </div><h4 id='method.remove_stream' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#tymethod.remove_stream' class='fnname'>remove_stream</a>(&mut self, stream_id: <a class='type' href='../../../solicit/http/type.StreamId.html' title='solicit::http::StreamId'>StreamId</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><Self::Stream></code></h4> <div class='docblock'><p>Removes the stream with the given <code>StreamId</code> from the session. If the stream was found in the session, it is returned in the result. <a href="../../../solicit/http/session/trait.SessionState.html#tymethod.remove_stream">Read more</a></p> </div><h4 id='method.iter' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#tymethod.iter' class='fnname'>iter</a>(&mut self) -> <a class='struct' href='../../../solicit/http/session/struct.StreamIter.html' title='solicit::http::session::StreamIter'>StreamIter</a><S></code></h4> <div class='docblock'><p>Returns an iterator over the streams currently found in the session.</p> </div><h4 id='method.get_closed' class='method'><code>fn <a href='../../../solicit/http/session/trait.SessionState.html#method.get_closed' class='fnname'>get_closed</a>(&mut self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><Self::Stream></code></h4> <div class='docblock'><p>Returns all streams that are closed and tracked by the session state. <a href="../../../solicit/http/session/trait.SessionState.html#method.get_closed">Read more</a></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>