mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
20 lines
18 KiB
HTML
20 lines
18 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 `IsString` trait in crate `syntax`."><title>IsString in syntax::ast - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="syntax" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.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 trait"><!--[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="../../syntax/index.html">syntax</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">IsString</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.MODE" title="MODE">MODE</a></li><li><a href="#associatedconstant.RAW_PREFIX" title="RAW_PREFIX">RAW_PREFIX</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.close_quote_text_range" title="close_quote_text_range">close_quote_text_range</a></li><li><a href="#method.escaped_char_ranges" title="escaped_char_ranges">escaped_char_ranges</a></li><li><a href="#method.is_raw" title="is_raw">is_raw</a></li><li><a href="#method.map_range_up" title="map_range_up">map_range_up</a></li><li><a href="#method.open_quote_text_range" title="open_quote_text_range">open_quote_text_range</a></li><li><a href="#method.quote_offsets" title="quote_offsets">quote_offsets</a></li><li><a href="#method.text_range_between_quotes" title="text_range_between_quotes">text_range_between_quotes</a></li><li><a href="#method.text_without_quotes" title="text_without_quotes">text_without_quotes</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><a href="index.html">In syntax::<wbr>ast</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="../index.html">syntax</a>::<wbr><a href="index.html">ast</a></span><h1>Trait <span class="trait">IsString</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/ast/token_ext.rs.html#151-202">Source</a> </span></div><pre class="rust item-decl"><code>pub trait IsString: <a class="trait" href="trait.AstToken.html" title="t
|
||
|
const <a href="#associatedconstant.RAW_PREFIX" class="constant">RAW_PREFIX</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a>;
|
||
|
const <a href="#associatedconstant.MODE" class="constant">MODE</a>: <a class="enum" href="../unescape/enum.Mode.html" title="enum syntax::unescape::Mode">Mode</a>;
|
||
|
|
||
|
// Provided methods
|
||
|
fn <a href="#method.is_raw" class="fn">is_raw</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.quote_offsets" class="fn">quote_offsets</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.QuoteOffsets.html" title="struct syntax::ast::QuoteOffsets">QuoteOffsets</a>> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.text_range_between_quotes" class="fn">text_range_between_quotes</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.text_without_quotes" class="fn">text_without_quotes</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.open_quote_text_range" class="fn">open_quote_text_range</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.close_quote_text_range" class="fn">close_quote_text_range</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>> { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.escaped_char_ranges" class="fn">escaped_char_ranges</a>(
|
||
|
&self,
|
||
|
cb: &mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>, <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>, <a class="enum" href="../unescape/enum.EscapeError.html" title="enum syntax::unescape::EscapeError">EscapeError</a>>),
|
||
|
) { ... }
|
||
|
<span class="item-spacer"></span> fn <a href="#method.map_range_up" class="fn">map_range_up</a>(&self, range: <a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>> { ... }
|
||
|
}</code></pre><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><section id="associatedconstant.RAW_PREFIX" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#152">Source</a><h4 class="code-header">const <a href="#associatedconstant.RAW_PREFIX" class="constant">RAW_PREFIX</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a></h4></section><section id="associatedconstant.MODE" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#153">Source</a><h4 class="code-header">const <a href="#associatedconstant.MODE" class="constant">MODE</a>: <a class="enum" href="../unescape/enum.Mode.html" title="enum syntax::unescape::Mode">Mode</a></h4></section></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><section id="method.is_raw" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#154-156">Source</a><h4 class="code-header">fn <a href="#method.is_raw" class="fn">is_raw</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section><section id="method.quote_offsets" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#157-166">Source</a><h4 class="code-header">fn <a href="#method.quote_offsets" class="fn">quote_offsets</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.QuoteOffsets.html" title="struct syntax::ast::QuoteOffsets">QuoteOffsets</a>></h4></section><section id="method.text_range_between_quotes" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#167-169">Source</a><h4 class="code-header">fn <a href="#method.text_range_between_quotes" class="fn">text_range_between_quotes</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>></h4></section><section id="method.text_without_quotes" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#170-174">Source</a><h4 class="code-header">fn <a href="#method.text_without_quotes" class="fn">text_without_quotes</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a></h4></section><section id="method.open_quote_text_range" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#175-177">Source</a><h4 class="code-header">fn <a href="#method.open_quote_text_range" class="fn">open_quote_text_range</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>></h4></section><section id="method.close_quote_text_range" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#178-180">Source</a><h4 class="code-header">fn <a href="#method.close_quote_text_range" class="fn">close_quote_text_range</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>></h4></section><section id="method.escaped_char_ranges" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#181-193">Source</a><h4 class="code-header">fn <a href="#method.escaped_char_ranges" class="fn">escaped_char_ranges</a>(
|
||
|
&self,
|
||
|
cb: &mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>, <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>, <a class="enum" href="../unescape/enum.EscapeError.html" title="enum syntax::unescape::EscapeError">EscapeError</a>>),
|
||
|
)</h4></section><section id="method.map_range_up" class="method"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#194-201">Source</a><h4 class="code-header">fn <a href="#method.map_range_up" class="fn">map_range_up</a>(&self, range: <a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.TextRange.html" title="struct syntax::TextRange">TextRange</a>></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.84.0/reference/items/traits.html#object-safety">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"><details class="toggle implementors-toggle"><summary><section id="impl-IsString-for-ByteString" class="impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#245-248">Source</a><a href="#impl-IsString-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.IsString.html" title="trait syntax::ast::IsString">IsString</a> for <a class="struct" href="struct.ByteString.html" title="struct syntax::ast::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.RAW_PREFIX-1" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#246">Source</a><a href="#associatedconstant.RAW_PREFIX-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.RAW_PREFIX" class="constant">RAW_PREFIX</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a> = "br"</h4></section><section id="associatedconstant.MODE-1" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#247">Source</a><a href="#associatedconstant.MODE-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.MODE" class="constant">MODE</a>: <a class="enum" href="../unescape/enum.Mode.html" title="enum syntax::unescape::Mode">Mode</a> = Mode::ByteStr</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-IsString-for-CString" class="impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#286-308">Source</a><a href="#impl-IsString-for-CString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.IsString.html" title="trait syntax::ast::IsString">IsString</a> for <a class="struct" href="struct.CString.html" title="struct syntax::ast::CString">CString</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.RAW_PREFIX-2" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#287">Source</a><a href="#associatedconstant.RAW_PREFIX-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.RAW_PREFIX" class="constant">RAW_PREFIX</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a> = "cr"</h4></section><section id="associatedconstant.MODE-2" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/syntax/ast/token_ext.rs.html#288">Source</a><a href="#associatedconstant.MODE-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.MODE" class="constant">MODE</a>: <a class="enum" href="../unescape/enum.Mode.html" title="enum syntax::unescape::Mode">Mode</a> = Mode::CStr</h4></section></div></details><details class="to
|