mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-21 20:34:07 +00:00
22 lines
12 KiB
HTML
22 lines
12 KiB
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="API documentation for the Rust `TokenConverter` trait in crate `syntax_bridge`."><title>TokenConverter in syntax_bridge - 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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-77263533.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="syntax_bridge" data-themes="" data-resource-suffix="" data-rustdoc-version="1.94.0 (4a4ef493e 2026-03-02)" data-channel="1.94.0" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-b897f86f.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-7bab91a1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-ffcac47a.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">TokenConverter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../syntax_bridge/index.html">syntax_<wbr>bridge</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Token<wbr>Converter</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Token" title="Token">Token</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.bump" title="bump">bump</a></li><li><a href="#tymethod.call_site" title="call_site">call_site</a></li><li><a href="#tymethod.convert_doc_comment" title="convert_doc_comment">convert_doc_comment</a></li><li><a href="#tymethod.peek" title="peek">peek</a></li><li><a href="#tymethod.span_for" title="span_for">span_for</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate syntax_<wbr>bridge</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">syntax_bridge</a></div><h1>Trait <span class="trait">Token<wbr>Converter</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/syntax_bridge/lib.rs.html#491-508">Source</a> </span></div><pre class="rust item-decl"><code>pub(crate) trait TokenConverter: <a class="trait" href="https://doc.rust-lang.org/1.94.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
|
type <a href="#associatedtype.Token" class="associatedtype">Token</a>: <a class="trait" href="trait.SrcToken.html" title="trait syntax_bridge::SrcToken">SrcToken</a><Self>;
|
|
|
|
// Required methods
|
|
fn <a href="#tymethod.convert_doc_comment" class="fn">convert_doc_comment</a>(
|
|
&self,
|
|
token: &Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>,
|
|
span: Span,
|
|
builder: &mut TopSubtreeBuilder,
|
|
);
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bump" class="fn">bump</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.94.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>, TextRange)>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.peek" class="fn">peek</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.94.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.span_for" class="fn">span_for</a>(&self, range: TextRange) -> Span;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.call_site" class="fn">call_site</a>(&self) -> Span;
|
|
}</code></pre><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.Token" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#492">Source</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a>: <a class="trait" href="trait.SrcToken.html" title="trait syntax_bridge::SrcToken">SrcToken</a><Self></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.convert_doc_comment" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#494-499">Source</a><h4 class="code-header">fn <a href="#tymethod.convert_doc_comment" class="fn">convert_doc_comment</a>(
|
|
&self,
|
|
token: &Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>,
|
|
span: Span,
|
|
builder: &mut TopSubtreeBuilder,
|
|
)</h4></section><section id="tymethod.bump" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#501">Source</a><h4 class="code-header">fn <a href="#tymethod.bump" class="fn">bump</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.94.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>, TextRange)></h4></section><section id="tymethod.peek" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#503">Source</a><h4 class="code-header">fn <a href="#tymethod.peek" class="fn">peek</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.94.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="trait.TokenConverter.html#associatedtype.Token" title="type syntax_bridge::TokenConverter::Token">Token</a>></h4></section><section id="tymethod.span_for" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#505">Source</a><h4 class="code-header">fn <a href="#tymethod.span_for" class="fn">span_for</a>(&self, range: TextRange) -> Span</h4></section><section id="tymethod.call_site" class="method"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#507">Source</a><h4 class="code-header">fn <a href="#tymethod.call_site" class="fn">call_site</a>(&self) -> Span</h4></section></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.94.0/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><details class="toggle implementors-toggle"><summary><section id="impl-TokenConverter-for-RawConverter%3C'_%3E" class="impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#538-572">Source</a><a href="#impl-TokenConverter-for-RawConverter%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TokenConverter.html" title="trait syntax_bridge::TokenConverter">TokenConverter</a> for <a class="struct" href="struct.RawConverter.html" title="struct syntax_bridge::RawConverter">RawConverter</a><'_></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#539">Source</a><a href="#associatedtype.Token-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="primitive" href="https://doc.rust-lang.org/1.94.0/std/primitive.usize.html">usize</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TokenConverter-for-StaticRawConverter%3C'_%3E" class="impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#574-608">Source</a><a href="#impl-TokenConverter-for-StaticRawConverter%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TokenConverter.html" title="trait syntax_bridge::TokenConverter">TokenConverter</a> for <a class="struct" href="struct.StaticRawConverter.html" title="struct syntax_bridge::StaticRawConverter">StaticRawConverter</a><'_></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#575">Source</a><a href="#associatedtype.Token-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="primitive" href="https://doc.rust-lang.org/1.94.0/std/primitive.usize.html">usize</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TokenConverter-for-Converter%3CSpanMap,+OnEvent%3E" class="impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#746-826">Source</a><a href="#impl-TokenConverter-for-Converter%3CSpanMap,+OnEvent%3E" class="anchor">§</a><h3 class="code-header">impl<SpanMap, OnEvent> <a class="trait" href="trait.TokenConverter.html" title="trait syntax_bridge::TokenConverter">TokenConverter</a> for <a class="struct" href="struct.Converter.html" title="struct syntax_bridge::Converter">Converter</a><SpanMap, OnEvent><div class="where">where
|
|
SpanMap: <a class="trait" href="trait.SpanMapper.html" title="trait syntax_bridge::SpanMapper">SpanMapper</a>,
|
|
OnEvent: <a class="trait" href="https://doc.rust-lang.org/1.94.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&mut PreorderWithTokens, &WalkEvent<SyntaxElement>) -> (<a class="primitive" href="https://doc.rust-lang.org/1.94.0/std/primitive.bool.html">bool</a>, <a class="struct" href="https://doc.rust-lang.org/1.94.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Leaf>),</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/syntax_bridge/lib.rs.html#751">Source</a><a href="#associatedtype.Token-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="enum" href="enum.SynToken.html" title="enum syntax_bridge::SynToken">SynToken</a></h4></section></div></details></div><script src="../trait.impl/syntax_bridge/trait.TokenConverter.js" async></script></section></div></main></body></html> |