mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 23:51:06 +01:00
Deploying to gh-pages from @ d3fb564380
🚀
This commit is contained in:
parent
d19e3159b9
commit
2eee0eb034
@ -25,18 +25,18 @@ request handlers and it will be automatically extracted from the incoming reques
|
||||
}</code></pre></div>
|
||||
<p>You can also retrieve a <a href="struct.Session.html" title="Session"><code>Session</code></a> object from an <code>HttpRequest</code> or a <code>ServiceRequest</code> using
|
||||
<a href="trait.SessionExt.html"><code>SessionExt</code></a>.</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Session" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#82-254">source</a></span><a href="#impl-Session" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#86-103">source</a></span><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a><T: <a class="trait" href="https://docs.rs/serde/1.0.138/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>>(<br> &self,<br> key: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><T>, <a class="struct" href="struct.SessionGetError.html" title="struct actix_session::SessionGetError">SessionGetError</a>></h4></section></summary><div class="docblock"><p>Get a <code>value</code> from the session.</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Session" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#82-254">source</a></span><a href="#impl-Session" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#86-103">source</a></span><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a><T: <a class="trait" href="https://docs.rs/serde/1.0.139/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>>(<br> &self,<br> key: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><T>, <a class="struct" href="struct.SessionGetError.html" title="struct actix_session::SessionGetError">SessionGetError</a>></h4></section></summary><div class="docblock"><p>Get a <code>value</code> from the session.</p>
|
||||
<p>It returns an error if it fails to deserialize as <code>T</code> the JSON value associated with <code>key</code>.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.entries" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#108-110">source</a></span><h4 class="code-header">pub fn <a href="#method.entries" class="fnname">entries</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/cell/struct.Ref.html" title="struct core::cell::Ref">Ref</a><'_, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></h4></section></summary><div class="docblock"><p>Get all raw key-value data from the session.</p>
|
||||
<p>Note that values are JSON encoded.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.status" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#113-115">source</a></span><h4 class="code-header">pub fn <a href="#method.status" class="fnname">status</a>(&self) -> <a class="enum" href="enum.SessionStatus.html" title="enum actix_session::SessionStatus">SessionStatus</a></h4></section></summary><div class="docblock"><p>Returns session status.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#123-149">source</a></span><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a><T: <a class="trait" href="https://docs.rs/serde/1.0.138/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a>>(<br> &self,<br> key: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br> value: T<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SessionInsertError.html" title="struct actix_session::SessionInsertError">SessionInsertError</a>></h4></section></summary><div class="docblock"><p>Inserts a key-value pair into the session.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#123-149">source</a></span><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a><T: <a class="trait" href="https://docs.rs/serde/1.0.139/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a>>(<br> &self,<br> key: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br> value: T<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SessionInsertError.html" title="struct actix_session::SessionInsertError">SessionInsertError</a>></h4></section></summary><div class="docblock"><p>Inserts a key-value pair into the session.</p>
|
||||
<p>Any serializable value can be used and will be encoded as JSON in session data, hence why
|
||||
only a reference to the value is taken.</p>
|
||||
<p>It returns an error if it fails to serialize <code>value</code> to JSON.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.remove" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#154-163">source</a></span><h4 class="code-header">pub fn <a href="#method.remove" class="fnname">remove</a>(&self, key: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>Remove value from the session.</p>
|
||||
<p>If present, the JSON encoded value is returned.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.remove_as" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#169-183">source</a></span><h4 class="code-header">pub fn <a href="#method.remove_as" class="fnname">remove_as</a><T: <a class="trait" href="https://docs.rs/serde/1.0.138/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>>(<br> &self,<br> key: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></h4></section></summary><div class="docblock"><p>Remove value from the session and deserialize.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.remove_as" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#169-183">source</a></span><h4 class="code-header">pub fn <a href="#method.remove_as" class="fnname">remove_as</a><T: <a class="trait" href="https://docs.rs/serde/1.0.139/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>>(<br> &self,<br> key: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></h4></section></summary><div class="docblock"><p>Remove value from the session and deserialize.</p>
|
||||
<p>Returns <code>None</code> if key was not present in session. Returns <code>T</code> if deserialization succeeds,
|
||||
otherwise returns un-deserialized JSON string.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clear" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/session.rs.html#186-193">source</a></span><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&self)</h4></section></summary><div class="docblock"><p>Clear the session.</p>
|
||||
|
Loading…
Reference in New Issue
Block a user