mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 15:51:06 +01:00
Deploying to gh-pages from @ actix/actix-extras@6b04450703 🚀
This commit is contained in:
parent
d57d78c8ae
commit
66afb9e19c
@ -1 +1 @@
|
||||
<!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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.CloseReason.html">CloseReason</a></li><li><a href="struct.Closed.html">Closed</a></li><li><a href="struct.MessageStream.html">MessageStream</a></li><li><a href="struct.Session.html">Session</a></li><li><a href="struct.StreamingBody.html">StreamingBody</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.CloseCode.html">CloseCode</a></li><li><a href="enum.Message.html">Message</a></li><li><a href="enum.ProtocolError.html">ProtocolError</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.handle.html">handle</a></li></ul></section></div></main></body></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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.CloseReason.html">CloseReason</a></li><li><a href="struct.Closed.html">Closed</a></li><li><a href="struct.MessageStream.html">MessageStream</a></li><li><a href="struct.Session.html">Session</a></li><li><a href="struct.StreamingBody.html">StreamingBody</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.CloseCode.html">CloseCode</a></li><li><a href="enum.Item.html">Item</a></li><li><a href="enum.Message.html">Message</a></li><li><a href="enum.ProtocolError.html">ProtocolError</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.handle.html">handle</a></li></ul></section></div></main></body></html>
|
25
actix_ws/enum.Item.html
Normal file
25
actix_ws/enum.Item.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!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="A WebSocket continuation item."><title>Item in actix_ws - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><h2 class="location"><a href="#">Item</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Continue">Continue</a></li><li><a href="#variant.FirstBinary">FirstBinary</a></li><li><a href="#variant.FirstText">FirstText</a></li><li><a href="#variant.Last">Last</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Item">Debug</a></li><li><a href="#impl-Eq-for-Item">Eq</a></li><li><a href="#impl-PartialEq-for-Item">PartialEq</a></li><li><a href="#impl-StructuralPartialEq-for-Item">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Item">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Item">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Item">Send</a></li><li><a href="#impl-Sync-for-Item">Sync</a></li><li><a href="#impl-Unpin-for-Item">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Item">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip<V></a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In crate actix_ws</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Enum <a href="index.html">actix_ws</a>::<wbr><a class="enum" href="#">Item</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub enum Item {
|
||||
FirstText(Bytes),
|
||||
FirstBinary(Bytes),
|
||||
Continue(Bytes),
|
||||
Last(Bytes),
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A WebSocket continuation item.</p>
|
||||
</div></details><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.FirstText" class="variant"><a href="#variant.FirstText" class="anchor">§</a><h3 class="code-header">FirstText(Bytes)</h3></section><section id="variant.FirstBinary" class="variant"><a href="#variant.FirstBinary" class="anchor">§</a><h3 class="code-header">FirstBinary(Bytes)</h3></section><section id="variant.Continue" class="variant"><a href="#variant.Continue" class="anchor">§</a><h3 class="code-header">Continue(Bytes)</h3></section><section id="variant.Last" class="variant"><a href="#variant.Last" class="anchor">§</a><h3 class="code-header">Last(Bytes)</h3></section></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Item" class="impl"><a href="#impl-Debug-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <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="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Item" class="impl"><a href="#impl-PartialEq-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
|
||||
by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#263">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
|
||||
sufficient, and should not be overridden without very good reason.</div></details></div></details><section id="impl-Eq-for-Item" class="impl"><a href="#impl-Eq-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-StructuralPartialEq-for-Item" class="impl"><a href="#impl-StructuralPartialEq-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Item" class="impl"><a href="#impl-Freeze-for-Item" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-RefUnwindSafe-for-Item" class="impl"><a href="#impl-RefUnwindSafe-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-Send-for-Item" class="impl"><a href="#impl-Send-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-Sync-for-Item" class="impl"><a href="#impl-Sync-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-Unpin-for-Item" class="impl"><a href="#impl-Unpin-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section><section id="impl-UnwindSafe-for-Item" class="impl"><a href="#impl-UnwindSafe-for-Item" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instrument-for-T" class="impl"><a href="#impl-Instrument-for-T" class="anchor">§</a><h3 class="code-header">impl<T> Instrument for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl"><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a class="fn">instrument</a>(self, span: Span) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the provided [<code>Span</code>], returning an
|
||||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a class="fn">in_current_span</a>(self) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the <a href="super::Span::current()">current</a> <a href="crate::Span"><code>Span</code></a>, returning an
|
||||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||||
<p>That is, this conversion is whatever the implementation of
|
||||
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Same-for-T" class="impl"><a class="src rightside" href="https://docs.rs/typenum/1.17.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/typenum/1.17.0/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a> for T</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.17.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-T" class="impl"><a href="#impl-VZip%3CV%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<V, T> VZip<V> for T<div class="where">where
|
||||
V: MultiLane<T>,</div></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl"><a href="#method.vzip" class="anchor">§</a><h4 class="code-header">fn <a class="fn">vzip</a>(self) -> V</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-T" class="impl"><a href="#impl-WithSubscriber-for-T" class="anchor">§</a><h3 class="code-header">impl<T> WithSubscriber for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl"><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_subscriber</a><S>(self, subscriber: S) -> WithDispatch<Self><div class="where">where
|
||||
S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><Dispatch>,</div></h4></section></summary><div class='docblock'>Attaches the provided <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_current_subscriber</a>(self) -> WithDispatch<Self></h4></section></summary><div class='docblock'>Attaches the current <a href="crate::dispatcher#setting-the-default-subscriber">default</a> <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details></div></details></div></section></div></main></body></html>
|
@ -1,7 +1,7 @@
|
||||
<!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="A WebSocket message."><title>Message in actix_ws - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><h2 class="location"><a href="#">Message</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Binary">Binary</a></li><li><a href="#variant.Close">Close</a></li><li><a href="#variant.Continuation">Continuation</a></li><li><a href="#variant.Nop">Nop</a></li><li><a href="#variant.Ping">Ping</a></li><li><a href="#variant.Pong">Pong</a></li><li><a href="#variant.Text">Text</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Message">Debug</a></li><li><a href="#impl-Eq-for-Message">Eq</a></li><li><a href="#impl-PartialEq-for-Message">PartialEq</a></li><li><a href="#impl-StructuralPartialEq-for-Message">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Message">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Message">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Message">Send</a></li><li><a href="#impl-Sync-for-Message">Sync</a></li><li><a href="#impl-Unpin-for-Message">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Message">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip<V></a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In crate actix_ws</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Enum <a href="index.html">actix_ws</a>::<wbr><a class="enum" href="#">Message</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub enum Message {
|
||||
Text(ByteString),
|
||||
Binary(Bytes),
|
||||
Continuation(Item),
|
||||
Continuation(<a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a>),
|
||||
Ping(Bytes),
|
||||
Pong(Bytes),
|
||||
Close(<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="struct.CloseReason.html" title="struct actix_ws::CloseReason">CloseReason</a>>),
|
||||
@ -9,7 +9,7 @@
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A WebSocket message.</p>
|
||||
</div></details><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Text" class="variant"><a href="#variant.Text" class="anchor">§</a><h3 class="code-header">Text(ByteString)</h3></section><div class="docblock"><p>Text message.</p>
|
||||
</div><section id="variant.Binary" class="variant"><a href="#variant.Binary" class="anchor">§</a><h3 class="code-header">Binary(Bytes)</h3></section><div class="docblock"><p>Binary message.</p>
|
||||
</div><section id="variant.Continuation" class="variant"><a href="#variant.Continuation" class="anchor">§</a><h3 class="code-header">Continuation(Item)</h3></section><div class="docblock"><p>Continuation.</p>
|
||||
</div><section id="variant.Continuation" class="variant"><a href="#variant.Continuation" class="anchor">§</a><h3 class="code-header">Continuation(<a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a>)</h3></section><div class="docblock"><p>Continuation.</p>
|
||||
</div><section id="variant.Ping" class="variant"><a href="#variant.Ping" class="anchor">§</a><h3 class="code-header">Ping(Bytes)</h3></section><div class="docblock"><p>Ping message.</p>
|
||||
</div><section id="variant.Pong" class="variant"><a href="#variant.Pong" class="anchor">§</a><h3 class="code-header">Pong(Bytes)</h3></section><div class="docblock"><p>Pong message.</p>
|
||||
</div><section id="variant.Close" class="variant"><a href="#variant.Close" class="anchor">§</a><h3 class="code-header">Close(<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="struct.CloseReason.html" title="struct actix_ws::CloseReason">CloseReason</a>>)</h3></section><div class="docblock"><p>Close message with optional reason.</p>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<!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="WebSockets for Actix Web, without actors."><title>actix_ws - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">actix_ws</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/actix_ws/lib.rs.html#1-84">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>WebSockets for Actix Web, without actors.</p>
|
||||
<p>For usage, see documentation on <a href="fn.handle.html" title="fn actix_ws::handle"><code>handle()</code></a>.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.CloseReason.html" title="struct actix_ws::CloseReason">CloseReason</a></div><div class="desc docblock-short">Reason for closing the connection</div></li><li><div class="item-name"><a class="struct" href="struct.Closed.html" title="struct actix_ws::Closed">Closed</a></div><div class="desc docblock-short">The error representing a closed websocket session</div></li><li><div class="item-name"><a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></div><div class="desc docblock-short">A stream of Messages from a websocket client</div></li><li><div class="item-name"><a class="struct" href="struct.Session.html" title="struct actix_ws::Session">Session</a></div><div class="desc docblock-short">A handle into the websocket session.</div></li><li><div class="item-name"><a class="struct" href="struct.StreamingBody.html" title="struct actix_ws::StreamingBody">StreamingBody</a></div><div class="desc docblock-short">A response body for Websocket HTTP Requests</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.CloseCode.html" title="enum actix_ws::CloseCode">CloseCode</a></div><div class="desc docblock-short">Status code used to indicate why an endpoint is closing the WebSocket connection.</div></li><li><div class="item-name"><a class="enum" href="enum.Message.html" title="enum actix_ws::Message">Message</a></div><div class="desc docblock-short">A WebSocket message.</div></li><li><div class="item-name"><a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a></div><div class="desc docblock-short">WebSocket protocol errors.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.handle.html" title="fn actix_ws::handle">handle</a></div><div class="desc docblock-short">Begin handling websocket traffic</div></li></ul></section></div></main></body></html>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.CloseReason.html" title="struct actix_ws::CloseReason">CloseReason</a></div><div class="desc docblock-short">Reason for closing the connection</div></li><li><div class="item-name"><a class="struct" href="struct.Closed.html" title="struct actix_ws::Closed">Closed</a></div><div class="desc docblock-short">The error representing a closed websocket session</div></li><li><div class="item-name"><a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></div><div class="desc docblock-short">A stream of Messages from a websocket client</div></li><li><div class="item-name"><a class="struct" href="struct.Session.html" title="struct actix_ws::Session">Session</a></div><div class="desc docblock-short">A handle into the websocket session.</div></li><li><div class="item-name"><a class="struct" href="struct.StreamingBody.html" title="struct actix_ws::StreamingBody">StreamingBody</a></div><div class="desc docblock-short">A response body for Websocket HTTP Requests</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.CloseCode.html" title="enum actix_ws::CloseCode">CloseCode</a></div><div class="desc docblock-short">Status code used to indicate why an endpoint is closing the WebSocket connection.</div></li><li><div class="item-name"><a class="enum" href="enum.Item.html" title="enum actix_ws::Item">Item</a></div><div class="desc docblock-short">A WebSocket continuation item.</div></li><li><div class="item-name"><a class="enum" href="enum.Message.html" title="enum actix_ws::Message">Message</a></div><div class="desc docblock-short">A WebSocket message.</div></li><li><div class="item-name"><a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a></div><div class="desc docblock-short">WebSocket protocol errors.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.handle.html" title="fn actix_ws::handle">handle</a></div><div class="desc docblock-short">Begin handling websocket traffic</div></li></ul></section></div></main></body></html>
|
@ -1 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["CloseCode","Message","ProtocolError"],"fn":["handle"],"struct":["CloseReason","Closed","MessageStream","Session","StreamingBody"]};
|
||||
window.SIDEBAR_ITEMS = {"enum":["CloseCode","Item","Message","ProtocolError"],"fn":["handle"],"struct":["CloseReason","Closed","MessageStream","Session","StreamingBody"]};
|
@ -1,11 +1,11 @@
|
||||
<!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="A stream of Messages from a websocket client"><title>MessageStream in actix_ws - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><h2 class="location"><a href="#">MessageStream</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.recv">recv</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Stream-for-MessageStream">Stream</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-MessageStream">!RefUnwindSafe</a></li><li><a href="#impl-Send-for-MessageStream">!Send</a></li><li><a href="#impl-Sync-for-MessageStream">!Sync</a></li><li><a href="#impl-UnwindSafe-for-MessageStream">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-MessageStream">Freeze</a></li><li><a href="#impl-Unpin-for-MessageStream">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-StreamExt-for-T">StreamExt</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li><li><a href="#impl-TryStream-for-S">TryStream</a></li><li><a href="#impl-TryStreamExt-for-S">TryStreamExt</a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip<V></a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In crate actix_ws</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="index.html">actix_ws</a>::<wbr><a class="struct" href="#">MessageStream</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/actix_ws/fut.rs.html#34-41">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub struct MessageStream { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A stream of Messages from a websocket client</p>
|
||||
<p>Messages can be accessed via the stream’s <code>.next()</code> method</p>
|
||||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-MessageStream" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#55-76">source</a><a href="#impl-MessageStream" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.recv" class="method"><a class="src rightside" href="../src/actix_ws/fut.rs.html#73-75">source</a><h4 class="code-header">pub async fn <a href="#method.recv" class="fn">recv</a>(&mut self) -> <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><<a class="enum" href="enum.Message.html" title="enum actix_ws::Message">Message</a>, <a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a>>></h4></section></summary><div class="docblock"><p>Wait for the next item from the message stream</p>
|
||||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-MessageStream" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#55-79">source</a><a href="#impl-MessageStream" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.recv" class="method"><a class="src rightside" href="../src/actix_ws/fut.rs.html#76-78">source</a><h4 class="code-header">pub async fn <a href="#method.recv" class="fn">recv</a>(&mut self) -> <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><<a class="enum" href="enum.Message.html" title="enum actix_ws::Message">Message</a>, <a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a>>></h4></section></summary><div class="docblock"><p>Wait for the next item from the message stream</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">while let </span><span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(msg)) = stream.recv().<span class="kw">await </span>{
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">while let </span><span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(msg)) = stream.recv().<span class="kw">await </span>{
|
||||
<span class="comment">// handle message
|
||||
</span>}</code></pre></div>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Stream-for-MessageStream" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#115-183">source</a><a href="#impl-Stream-for-MessageStream" class="anchor">§</a><h3 class="code-header">impl Stream for <a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Item</a> = <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="enum.Message.html" title="enum actix_ws::Message">Message</a>, <a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a>></h4></section></summary><div class='docblock'>Values yielded by the stream.</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_next" class="method trait-impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#118-182">source</a><a href="#method.poll_next" class="anchor">§</a><h4 class="code-header">fn <a class="fn">poll_next</a>(
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Stream-for-MessageStream" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#118-186">source</a><a href="#impl-Stream-for-MessageStream" class="anchor">§</a><h3 class="code-header">impl Stream for <a class="struct" href="struct.MessageStream.html" title="struct actix_ws::MessageStream">MessageStream</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Item</a> = <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="enum.Message.html" title="enum actix_ws::Message">Message</a>, <a class="enum" href="enum.ProtocolError.html" title="enum actix_ws::ProtocolError">ProtocolError</a>></h4></section></summary><div class='docblock'>Values yielded by the stream.</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_next" class="method trait-impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#121-185">source</a><a href="#method.poll_next" class="anchor">§</a><h4 class="code-header">fn <a class="fn">poll_next</a>(
|
||||
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut Self</a>>,
|
||||
cx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::Item>></h4></section></summary><div class='docblock'>Attempt to pull out the next value of this stream, registering the
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
<!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="A response body for Websocket HTTP Requests"><title>StreamingBody in actix_ws - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_ws/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_ws/index.html">actix_ws</a><span class="version">0.2.0</span></h2></div><h2 class="location"><a href="#">StreamingBody</a></h2><div class="sidebar-elems"><section><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Stream-for-StreamingBody">Stream</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-StreamingBody">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-StreamingBody">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-StreamingBody">Freeze</a></li><li><a href="#impl-Send-for-StreamingBody">Send</a></li><li><a href="#impl-Sync-for-StreamingBody">Sync</a></li><li><a href="#impl-Unpin-for-StreamingBody">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-StreamExt-for-T">StreamExt</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li><li><a href="#impl-TryStream-for-S">TryStream</a></li><li><a href="#impl-TryStreamExt-for-S">TryStreamExt</a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip<V></a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In crate actix_ws</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="index.html">actix_ws</a>::<wbr><a class="struct" href="#">StreamingBody</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/actix_ws/fut.rs.html#22-29">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub struct StreamingBody { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A response body for Websocket HTTP Requests</p>
|
||||
</div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Stream-for-StreamingBody" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#78-113">source</a><a href="#impl-Stream-for-StreamingBody" class="anchor">§</a><h3 class="code-header">impl Stream for <a class="struct" href="struct.StreamingBody.html" title="struct actix_ws::StreamingBody">StreamingBody</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Item</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Bytes, Error></h4></section></summary><div class='docblock'>Values yielded by the stream.</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_next" class="method trait-impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#81-112">source</a><a href="#method.poll_next" class="anchor">§</a><h4 class="code-header">fn <a class="fn">poll_next</a>(
|
||||
</div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Stream-for-StreamingBody" class="impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#81-116">source</a><a href="#impl-Stream-for-StreamingBody" class="anchor">§</a><h3 class="code-header">impl Stream for <a class="struct" href="struct.StreamingBody.html" title="struct actix_ws::StreamingBody">StreamingBody</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Item</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Bytes, Error></h4></section></summary><div class='docblock'>Values yielded by the stream.</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_next" class="method trait-impl"><a class="src rightside" href="../src/actix_ws/fut.rs.html#84-115">source</a><a href="#method.poll_next" class="anchor">§</a><h4 class="code-header">fn <a class="fn">poll_next</a>(
|
||||
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut Self</a>>,
|
||||
cx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::Item>></h4></section></summary><div class='docblock'>Attempt to pull out the next value of this stream, registering the
|
||||
|
@ -1 +1 @@
|
||||
<!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="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="actix_session" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="./static.files/storage-118b08c4c78b968e.js"></script><script defer src="./static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.80.0-nightly</span></h2></div><div class="version">(ef0027897 2024-05-12)</div><h2 class="location">Help</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc help</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section><p>You need to enable JavaScript to use keyboard commands or search.</p><p>For more information, browse the <a href="https://doc.rust-lang.org/rustdoc/">rustdoc handbook</a>.</p></section></noscript></section></div></main></body></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="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="./static.files/storage-118b08c4c78b968e.js"></script><script defer src="./static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.80.0-nightly</span></h2></div><div class="version">(ef0027897 2024-05-12)</div><h2 class="location">Help</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc help</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section><p>You need to enable JavaScript to use keyboard commands or search.</p><p>For more information, browse the <a href="https://doc.rust-lang.org/rustdoc/">rustdoc handbook</a>.</p></section></noscript></section></div></main></body></html>
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
searchState.loadedDescShard("actix_ws", 0, "WebSockets for Actix Web, without actors.\nIndicates an abnormal closure. If the abnormal closure was …\nIndicates that the server is overloaded and the client …\nIndicates that an endpoint is “going away”, such as a …\nBad opcode.\nBinary message.\nClose message with optional reason.\nStatus code used to indicate why an endpoint is closing …\nReason for closing the connection\nThe error representing a closed websocket session\nContinuation.\nUnknown continuation fragment.\nContinuation has not started.\nReceived new continuation but it is already started.\nIndicates that a server is terminating the connection …\nIndicates that an endpoint (client) is terminating the …\nIndicates that an endpoint is terminating the connection …\nInvalid control frame length\nEncountered invalid opcode.\nI/O error.\nReceived a masked frame from server.\nA WebSocket message.\nA stream of Messages from a websocket client\nNo-op. Useful for low-level services.\nIndicates a normal closure, meaning that the purpose for …\nA payload reached size limit.\nPing message.\nIndicates that an endpoint is terminating the connection …\nPong message.\nIndicates that an endpoint is terminating the connection …\nWebSocket protocol errors.\nIndicates that the server is restarting. A client may …\nA handle into the websocket session.\nIndicates that an endpoint is terminating the connection …\nA response body for Websocket HTTP Requests\nText message.\nReceived an unmasked frame from client.\nIndicates that an endpoint is terminating the connection …\nSend raw bytes into the websocket\nSend a close message, and consume the session\nExit code\nOptional description of the exit code\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nBegin handling websocket traffic\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nPing the client\nPong the client\nWait for the next item from the message stream\nSend text into the websocket")
|
||||
searchState.loadedDescShard("actix_ws", 0, "WebSockets for Actix Web, without actors.\nIndicates an abnormal closure. If the abnormal closure was …\nIndicates that the server is overloaded and the client …\nIndicates that an endpoint is “going away”, such as a …\nBad opcode.\nBinary message.\nClose message with optional reason.\nStatus code used to indicate why an endpoint is closing …\nReason for closing the connection\nThe error representing a closed websocket session\nContinuation.\nUnknown continuation fragment.\nContinuation has not started.\nReceived new continuation but it is already started.\nIndicates that a server is terminating the connection …\nIndicates that an endpoint (client) is terminating the …\nIndicates that an endpoint is terminating the connection …\nInvalid control frame length\nEncountered invalid opcode.\nI/O error.\nA WebSocket continuation item.\nReceived a masked frame from server.\nA WebSocket message.\nA stream of Messages from a websocket client\nNo-op. Useful for low-level services.\nIndicates a normal closure, meaning that the purpose for …\nA payload reached size limit.\nPing message.\nIndicates that an endpoint is terminating the connection …\nPong message.\nIndicates that an endpoint is terminating the connection …\nWebSocket protocol errors.\nIndicates that the server is restarting. A client may …\nA handle into the websocket session.\nIndicates that an endpoint is terminating the connection …\nA response body for Websocket HTTP Requests\nText message.\nReceived an unmasked frame from client.\nIndicates that an endpoint is terminating the connection …\nSend raw bytes into the websocket\nSend a close message, and consume the session\nExit code\nManually control sending continuations\nOptional description of the exit code\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nBegin handling websocket traffic\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nPing the client\nPong the client\nWait for the next item from the message stream\nSend text into the websocket")
|
@ -1 +1 @@
|
||||
<!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="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="actix_session" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="./static.files/storage-118b08c4c78b968e.js"></script><script defer src="./static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.80.0-nightly</span></h2></div><div class="version">(ef0027897 2024-05-12)</div><h2 class="location">Settings</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc settings</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section>You need to enable JavaScript be able to update your settings.</section></noscript><script defer src="./static.files/settings-4313503d2e1961c2.js"></script></section></div></main></body></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="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="actix_ws" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ef0027897 2024-05-12)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="./static.files/storage-118b08c4c78b968e.js"></script><script defer src="./static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.80.0-nightly</span></h2></div><div class="version">(ef0027897 2024-05-12)</div><h2 class="location">Settings</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc settings</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section>You need to enable JavaScript be able to update your settings.</section></noscript><script defer src="./static.files/settings-4313503d2e1961c2.js"></script></section></div></main></body></html>
|
@ -181,6 +181,9 @@
|
||||
<a href="#181" id="181">181</a>
|
||||
<a href="#182" id="182">182</a>
|
||||
<a href="#183" id="183">183</a>
|
||||
<a href="#184" id="184">184</a>
|
||||
<a href="#185" id="185">185</a>
|
||||
<a href="#186" id="186">186</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{
|
||||
collections::VecDeque,
|
||||
future::poll_fn,
|
||||
@ -248,10 +251,13 @@
|
||||
|
||||
<span class="doccomment">/// Wait for the next item from the message stream
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::MessageStream;
|
||||
/// # async fn test(mut stream: MessageStream) {
|
||||
/// while let Some(Ok(msg)) = stream.recv().await {
|
||||
/// // handle message
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>recv(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Option</span><<span class="prelude-ty">Result</span><Message, ProtocolError>> {
|
||||
poll_fn(|cx| Pin::new(<span class="kw-2">&mut *</span><span class="self">self</span>).poll_next(cx)).<span class="kw">await
|
||||
|
@ -92,7 +92,7 @@
|
||||
#![doc(html_favicon_url = <span class="string">"https://actix.rs/favicon.ico"</span>)]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
||||
</span><span class="kw">pub use </span>actix_http::ws::{CloseCode, CloseReason, Message, ProtocolError};
|
||||
</span><span class="kw">pub use </span>actix_http::ws::{CloseCode, CloseReason, Item, Message, ProtocolError};
|
||||
<span class="kw">use </span>actix_http::{
|
||||
body::{BodyStream, MessageBody},
|
||||
ws::handshake,
|
||||
|
@ -141,12 +141,59 @@
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
<a href="#149" id="149">149</a>
|
||||
<a href="#150" id="150">150</a>
|
||||
<a href="#151" id="151">151</a>
|
||||
<a href="#152" id="152">152</a>
|
||||
<a href="#153" id="153">153</a>
|
||||
<a href="#154" id="154">154</a>
|
||||
<a href="#155" id="155">155</a>
|
||||
<a href="#156" id="156">156</a>
|
||||
<a href="#157" id="157">157</a>
|
||||
<a href="#158" id="158">158</a>
|
||||
<a href="#159" id="159">159</a>
|
||||
<a href="#160" id="160">160</a>
|
||||
<a href="#161" id="161">161</a>
|
||||
<a href="#162" id="162">162</a>
|
||||
<a href="#163" id="163">163</a>
|
||||
<a href="#164" id="164">164</a>
|
||||
<a href="#165" id="165">165</a>
|
||||
<a href="#166" id="166">166</a>
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
<a href="#177" id="177">177</a>
|
||||
<a href="#178" id="178">178</a>
|
||||
<a href="#179" id="179">179</a>
|
||||
<a href="#180" id="180">180</a>
|
||||
<a href="#181" id="181">181</a>
|
||||
<a href="#182" id="182">182</a>
|
||||
<a href="#183" id="183">183</a>
|
||||
<a href="#184" id="184">184</a>
|
||||
<a href="#185" id="185">185</a>
|
||||
<a href="#186" id="186">186</a>
|
||||
<a href="#187" id="187">187</a>
|
||||
<a href="#188" id="188">188</a>
|
||||
<a href="#189" id="189">189</a>
|
||||
<a href="#190" id="190">190</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
};
|
||||
|
||||
<span class="kw">use </span>actix_http::ws::{CloseReason, Message};
|
||||
<span class="kw">use </span>actix_http::ws::{CloseReason, Item, Message};
|
||||
<span class="kw">use </span>actix_web::web::Bytes;
|
||||
<span class="kw">use </span>bytestring::ByteString;
|
||||
<span class="kw">use </span>tokio::sync::mpsc::Sender;
|
||||
@ -188,10 +235,13 @@
|
||||
|
||||
<span class="doccomment">/// Send text into the websocket
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::Session;
|
||||
/// # async fn test(mut session: Session) {
|
||||
/// if session.text("Some text").await.is_err() {
|
||||
/// // session closed
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>text(<span class="kw-2">&mut </span><span class="self">self</span>, msg: <span class="kw">impl </span>Into<ByteString>) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
@ -207,10 +257,13 @@
|
||||
|
||||
<span class="doccomment">/// Send raw bytes into the websocket
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// if session.binary(b"some bytes").await.is_err() {
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::Session;
|
||||
/// # async fn test(mut session: Session) {
|
||||
/// if session.binary(&b"some bytes"[..]).await.is_err() {
|
||||
/// // session closed
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>binary(<span class="kw-2">&mut </span><span class="self">self</span>, msg: <span class="kw">impl </span>Into<Bytes>) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
@ -229,10 +282,13 @@
|
||||
/// For many applications, it will be important to send regular pings to keep track of if the
|
||||
/// client has disconnected
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::Session;
|
||||
/// # async fn test(mut session: Session) {
|
||||
/// if session.ping(b"").await.is_err() {
|
||||
/// // session is closed
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>ping(<span class="kw-2">&mut </span><span class="self">self</span>, msg: <span class="kw-2">&</span>[u8]) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
@ -248,13 +304,16 @@
|
||||
|
||||
<span class="doccomment">/// Pong the client
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::{Message, Session};
|
||||
/// # async fn test(mut session: Session, msg: Message) {
|
||||
/// match msg {
|
||||
/// Message::Ping(bytes) => {
|
||||
/// let _ = session.pong(&bytes).await;
|
||||
/// }
|
||||
/// _ => (),
|
||||
/// }
|
||||
/// # }
|
||||
</span><span class="kw">pub async fn </span>pong(<span class="kw-2">&mut </span><span class="self">self</span>, msg: <span class="kw-2">&</span>[u8]) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(inner) = <span class="self">self</span>.inner.as_mut() {
|
||||
@ -267,12 +326,47 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Manually control sending continuations
|
||||
///
|
||||
/// Be wary of this method. Continuations represent multiple frames that, when combined, are
|
||||
/// presented as a single message. They are useful when the entire contents of a message are
|
||||
/// not avilable all at once. However, continuations MUST NOT be interrupted by other Text or
|
||||
/// Binary messages. Control messages such as Ping, Pong, or Close are allowed to interrupt a
|
||||
/// continuation.
|
||||
///
|
||||
/// Continuations must be initialized with a First variant, and must be terminated by a Last
|
||||
/// variant, with only Continue variants sent in between.
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::{Item, Session};
|
||||
/// # async fn test(mut session: Session) -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// session.continuation(Item::FirstText("Hello".into())).await?;
|
||||
/// session.continuation(Item::Continue(b", World"[..].into())).await?;
|
||||
/// session.continuation(Item::Last(b"!"[..].into())).await?;
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>continuation(<span class="kw-2">&mut </span><span class="self">self</span>, msg: Item) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(inner) = <span class="self">self</span>.inner.as_mut() {
|
||||
inner
|
||||
.send(Message::Continuation(msg))
|
||||
.<span class="kw">await
|
||||
</span>.map_err(|<span class="kw">_</span>| Closed)
|
||||
} <span class="kw">else </span>{
|
||||
<span class="prelude-val">Err</span>(Closed)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Send a close message, and consume the session
|
||||
///
|
||||
/// All clones will return `Err(Closed)` if used after this call
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// ```rust,no_run
|
||||
/// # use actix_ws::{Closed, Session};
|
||||
/// # async fn test(mut session: Session) -> Result<(), Closed> {
|
||||
/// session.close(None).await
|
||||
/// # }
|
||||
/// ```
|
||||
</span><span class="kw">pub async fn </span>close(<span class="kw-2">mut </span><span class="self">self</span>, reason: <span class="prelude-ty">Option</span><CloseReason>) -> <span class="prelude-ty">Result</span><(), Closed> {
|
||||
<span class="self">self</span>.pre_check();
|
||||
|
Loading…
Reference in New Issue
Block a user