blob: e80d5d00fbc464f456a190f9d74e2dc4abec2b2f [file] [log] [blame] [edit]
<!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="Connection is just a pair of channels of LSP messages."><title>Connection in lsp_server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="lsp_server" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0 (1159e78c4 2025-09-14)" data-channel="1.90.0" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../lsp_server/index.html">lsp_<wbr>server</a><span class="version">0.7.9</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Connection</a></h2><h3><a href="#fields">Fields</a></h3><ul class="block structfield"><li><a href="#structfield.receiver" title="receiver">receiver</a></li><li><a href="#structfield.sender" title="sender">sender</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.connect" title="connect">connect</a></li><li><a href="#method.handle_shutdown" title="handle_shutdown">handle_shutdown</a></li><li><a href="#method.initialize" title="initialize">initialize</a></li><li><a href="#method.initialize_finish" title="initialize_finish">initialize_finish</a></li><li><a href="#method.initialize_finish_while" title="initialize_finish_while">initialize_finish_while</a></li><li><a href="#method.initialize_start" title="initialize_start">initialize_start</a></li><li><a href="#method.initialize_start_while" title="initialize_start_while">initialize_start_while</a></li><li><a href="#method.initialize_while" title="initialize_while">initialize_while</a></li><li><a href="#method.listen" title="listen">listen</a></li><li><a href="#method.memory" title="memory">memory</a></li><li><a href="#method.stdio" title="stdio">stdio</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Connection" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Connection" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Connection" title="Send">Send</a></li><li><a href="#impl-Sync-for-Connection" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Connection" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Connection" title="UnwindSafe">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" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate lsp_<wbr>server</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">lsp_server</a></div><h1>Struct <span class="struct">Connection</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/lsp_server/lib.rs.html#31-34">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Connection {
pub sender: Sender&lt;<a class="enum" href="enum.Message.html" title="enum lsp_server::Message">Message</a>&gt;,
pub receiver: Receiver&lt;<a class="enum" href="enum.Message.html" title="enum lsp_server::Message">Message</a>&gt;,
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Connection is just a pair of channels of LSP messages.</p>
</div></details><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield.sender" class="structfield section-header"><a href="#structfield.sender" class="anchor field">§</a><code>sender: Sender&lt;<a class="enum" href="enum.Message.html" title="enum lsp_server::Message">Message</a>&gt;</code></span><span id="structfield.receiver" class="structfield section-header"><a href="#structfield.receiver" class="anchor field">§</a><code>receiver: Receiver&lt;<a class="enum" href="enum.Message.html" title="enum lsp_server::Message">Message</a>&gt;</code></span><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-Connection" class="impl"><a class="src rightside" href="../src/lsp_server/lib.rs.html#36-374">Source</a><a href="#impl-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.stdio" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#40-43">Source</a><h4 class="code-header">pub fn <a href="#method.stdio" class="fn">stdio</a>() -&gt; (<a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a>, <a class="struct" href="struct.IoThreads.html" title="struct lsp_server::IoThreads">IoThreads</a>)</h4></section></summary><div class="docblock"><p>Create connection over standard in/standard out.</p>
<p>Use this to create a real language server.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.connect" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#49-53">Source</a><h4 class="code-header">pub fn <a href="#method.connect" class="fn">connect</a>&lt;A: <a class="trait" href="https://doc.rust-lang.org/1.90.0/std/net/socket_addr/trait.ToSocketAddrs.html" title="trait std::net::socket_addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(addr: A) -&gt; <a class="type" href="https://doc.rust-lang.org/1.90.0/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;(<a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a>, <a class="struct" href="struct.IoThreads.html" title="struct lsp_server::IoThreads">IoThreads</a>)&gt;</h4></section></summary><div class="docblock"><p>Open a connection over tcp.
This call blocks until a connection is established.</p>
<p>Use this to create a real language server.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.listen" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#59-64">Source</a><h4 class="code-header">pub fn <a href="#method.listen" class="fn">listen</a>&lt;A: <a class="trait" href="https://doc.rust-lang.org/1.90.0/std/net/socket_addr/trait.ToSocketAddrs.html" title="trait std::net::socket_addr::ToSocketAddrs">ToSocketAddrs</a>&gt;(addr: A) -&gt; <a class="type" href="https://doc.rust-lang.org/1.90.0/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;(<a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a>, <a class="struct" href="struct.IoThreads.html" title="struct lsp_server::IoThreads">IoThreads</a>)&gt;</h4></section></summary><div class="docblock"><p>Listen for a connection over tcp.
This call blocks until a connection is established.</p>
<p>Use this to create a real language server.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.memory" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#69-73">Source</a><h4 class="code-header">pub fn <a href="#method.memory" class="fn">memory</a>() -&gt; (<a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a>, <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a>)</h4></section></summary><div class="docblock"><p>Creates a pair of connected connections.</p>
<p>Use this for testing.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize_start" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#116-118">Source</a><h4 class="code-header">pub fn <a href="#method.initialize_start" class="fn">initialize_start</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(<a class="struct" href="struct.RequestId.html" title="struct lsp_server::RequestId">RequestId</a>, <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>), <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;</h4></section></summary><div class="docblock"><p>Starts the initialization process by waiting for an initialize
request from the client. Use this for more advanced customization than
<code>initialize</code> can provide.</p>
<p>Returns the request id and serialized <code>InitializeParams</code> from the client.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>lsp_types::{ClientCapabilities, InitializeParams, ServerCapabilities};
<span class="kw">use </span>lsp_server::{Connection, Message, Request, RequestId, Response};
<span class="kw">fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error + Sync + Send&gt;&gt; {
<span class="comment">// Create the transport. Includes the stdio (stdin and stdout) versions but this could
// also be implemented to use sockets or HTTP.
</span><span class="kw">let </span>(connection, io_threads) = Connection::stdio();
<span class="comment">// Run the server
</span><span class="kw">let </span>(id, params) = connection.initialize_start()<span class="question-mark">?</span>;
<span class="kw">let </span>init_params: InitializeParams = serde_json::from_value(params).unwrap();
<span class="kw">let </span>client_capabilities: ClientCapabilities = init_params.capabilities;
<span class="kw">let </span>server_capabilities = ServerCapabilities::default();
<span class="kw">let </span>initialize_data = <span class="macro">serde_json::json!</span>({
<span class="string">"capabilities"</span>: server_capabilities,
<span class="string">"serverInfo"</span>: {
<span class="string">"name"</span>: <span class="string">"lsp-server-test"</span>,
<span class="string">"version"</span>: <span class="string">"0.1"
</span>}
});
connection.initialize_finish(id, initialize_data)<span class="question-mark">?</span>;
<span class="comment">// ... Run main loop ...
</span><span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize_start_while" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#149-191">Source</a><h4 class="code-header">pub fn <a href="#method.initialize_start_while" class="fn">initialize_start_while</a>&lt;C&gt;(
&amp;self,
running: C,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(<a class="struct" href="struct.RequestId.html" title="struct lsp_server::RequestId">RequestId</a>, <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>), <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;<div class="where">where
C: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Starts the initialization process by waiting for an initialize as described in
<a href="struct.Connection.html#method.initialize_start" title="method lsp_server::Connection::initialize_start"><code>Self::initialize_start</code></a> as long as <code>running</code> returns
<code>true</code> while the return value can be changed through a sig handler such as <code>CTRL + C</code>.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::sync::atomic::{AtomicBool, Ordering};
<span class="kw">use </span>std::sync::Arc;
<span class="kw">let </span>running = Arc::new(AtomicBool::new(<span class="bool-val">true</span>));
<span class="kw">let </span>r = running.clone();
ctrlc::set_handler(<span class="kw">move </span>|| {
r.store(<span class="bool-val">false</span>, Ordering::SeqCst);
}).expect(<span class="string">"Error setting Ctrl-C handler"</span>);
<span class="kw">let </span>(connection, io_threads) = Connection::stdio();
<span class="kw">let </span>res = connection.initialize_start_while(|| running.load(Ordering::SeqCst));
</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize_finish" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#194-208">Source</a><h4 class="code-header">pub fn <a href="#method.initialize_finish" class="fn">initialize_finish</a>(
&amp;self,
initialize_id: <a class="struct" href="struct.RequestId.html" title="struct lsp_server::RequestId">RequestId</a>,
initialize_result: <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;</h4></section></summary><div class="docblock"><p>Finishes the initialization process by sending an <code>InitializeResult</code> to the client</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize_finish_while" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#213-251">Source</a><h4 class="code-header">pub fn <a href="#method.initialize_finish_while" class="fn">initialize_finish_while</a>&lt;C&gt;(
&amp;self,
initialize_id: <a class="struct" href="struct.RequestId.html" title="struct lsp_server::RequestId">RequestId</a>,
initialize_result: <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>,
running: C,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;<div class="where">where
C: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Finishes the initialization process as described in <a href="struct.Connection.html#method.initialize_finish" title="method lsp_server::Connection::initialize_finish"><code>Self::initialize_finish</code></a> as
long as <code>running</code> returns <code>true</code> while the return value can be changed through a sig
handler such as <code>CTRL + C</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#280-293">Source</a><h4 class="code-header">pub fn <a href="#method.initialize" class="fn">initialize</a>(
&amp;self,
server_capabilities: <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;</h4></section></summary><div class="docblock"><p>Initialize the connection. Sends the server capabilities
to the client and returns the serialized client capabilities
on success. If more fine-grained initialization is required use
<code>initialize_start</code>/<code>initialize_finish</code>.</p>
<h5 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>lsp_types::ServerCapabilities;
<span class="kw">use </span>lsp_server::{Connection, Message, Request, RequestId, Response};
<span class="kw">fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error + Sync + Send&gt;&gt; {
<span class="comment">// Create the transport. Includes the stdio (stdin and stdout) versions but this could
// also be implemented to use sockets or HTTP.
</span><span class="kw">let </span>(connection, io_threads) = Connection::stdio();
<span class="comment">// Run the server
</span><span class="kw">let </span>server_capabilities = serde_json::to_value(<span class="kw-2">&amp;</span>ServerCapabilities::default()).unwrap();
<span class="kw">let </span>initialization_params = connection.initialize(server_capabilities)<span class="question-mark">?</span>;
<span class="comment">// ... Run main loop ...
</span><span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.initialize_while" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#328-345">Source</a><h4 class="code-header">pub fn <a href="#method.initialize_while" class="fn">initialize_while</a>&lt;C&gt;(
&amp;self,
server_capabilities: <a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>,
running: C,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.140/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;<div class="where">where
C: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Initialize the connection as described in <a href="struct.Connection.html#method.initialize" title="method lsp_server::Connection::initialize"><code>Self::initialize</code></a> as long as <code>running</code> returns
<code>true</code> while the return value can be changed through a sig handler such as <code>CTRL + C</code>.</p>
<h5 id="example-3"><a class="doc-anchor" href="#example-3">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::sync::atomic::{AtomicBool, Ordering};
<span class="kw">use </span>std::sync::Arc;
<span class="kw">let </span>running = Arc::new(AtomicBool::new(<span class="bool-val">true</span>));
<span class="kw">let </span>r = running.clone();
ctrlc::set_handler(<span class="kw">move </span>|| {
r.store(<span class="bool-val">false</span>, Ordering::SeqCst);
}).expect(<span class="string">"Error setting Ctrl-C handler"</span>);
<span class="kw">let </span>(connection, io_threads) = Connection::stdio();
<span class="kw">let </span>server_capabilities = serde_json::to_value(<span class="kw-2">&amp;</span>ServerCapabilities::default()).unwrap();
<span class="kw">let </span>initialization_params = connection.initialize_while(
server_capabilities,
|| running.load(Ordering::SeqCst)
);
</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.handle_shutdown" class="method"><a class="src rightside" href="../src/lsp_server/lib.rs.html#348-373">Source</a><h4 class="code-header">pub fn <a href="#method.handle_shutdown" class="fn">handle_shutdown</a>(&amp;self, req: &amp;<a class="struct" href="struct.Request.html" title="struct lsp_server::Request">Request</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.bool.html">bool</a>, <a class="struct" href="struct.ProtocolError.html" title="struct lsp_server::ProtocolError">ProtocolError</a>&gt;</h4></section></summary><div class="docblock"><p>If <code>req</code> is <code>Shutdown</code>, respond to it and return <code>true</code>, otherwise return <code>false</code></p>
</div></details></div></details></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-Connection" class="impl"><a href="#impl-Freeze-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section><section id="impl-RefUnwindSafe-for-Connection" class="impl"><a href="#impl-RefUnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section><section id="impl-Send-for-Connection" class="impl"><a href="#impl-Send-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section><section id="impl-Sync-for-Connection" class="impl"><a href="#impl-Sync-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section><section id="impl-Unpin-for-Connection" class="impl"><a href="#impl-Unpin-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</a></h3></section><section id="impl-UnwindSafe-for-Connection" class="impl"><a href="#impl-UnwindSafe-for-Connection" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Connection.html" title="struct lsp_server::Connection">Connection</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/1.90.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/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/1.90.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/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/1.90.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/convert/mod.rs.html#791">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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/1.90.0/src/core/convert/mod.rs.html#794">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; 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-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.90.0/src/core/convert/mod.rs.html#773-775">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</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/1.90.0/src/core/convert/mod.rs.html#783">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; 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/1.90.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</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/1.90.0/src/core/convert/mod.rs.html#833-835">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.90.0/src/core/convert/mod.rs.html#837">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/convert/mod.rs.html#840">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</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/1.90.0/src/core/convert/mod.rs.html#817-819">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.90.0/src/core/convert/mod.rs.html#821">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.90.0/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/1.90.0/src/core/convert/mod.rs.html#824">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.90.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.90.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>