mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-10 01:58:23 +00:00
192 lines
56 KiB
HTML
192 lines
56 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="A color is one specific type of ANSI escape code, and can refer to either the foreground or background color."><title>Color in nu_ansi_term - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-5bc39a1768837dd0.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="nu_ansi_term" data-themes="" data-resource-suffix="" data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)" data-channel="1.77.2" data-search-js="search-dd67cee4cfa65049.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-4c98445ec4002617.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-48f368f3872407c8.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../nu_ansi_term/index.html">nu_ansi_term</a><span class="version">0.46.0</span></h2></div><h2 class="location"><a href="#">Color</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Black">Black</a></li><li><a href="#variant.Blue">Blue</a></li><li><a href="#variant.Cyan">Cyan</a></li><li><a href="#variant.DarkGray">DarkGray</a></li><li><a href="#variant.Default">Default</a></li><li><a href="#variant.Fixed">Fixed</a></li><li><a href="#variant.Green">Green</a></li><li><a href="#variant.LightBlue">LightBlue</a></li><li><a href="#variant.LightCyan">LightCyan</a></li><li><a href="#variant.LightGray">LightGray</a></li><li><a href="#variant.LightGreen">LightGreen</a></li><li><a href="#variant.LightMagenta">LightMagenta</a></li><li><a href="#variant.LightPurple">LightPurple</a></li><li><a href="#variant.LightRed">LightRed</a></li><li><a href="#variant.LightYellow">LightYellow</a></li><li><a href="#variant.Magenta">Magenta</a></li><li><a href="#variant.Purple">Purple</a></li><li><a href="#variant.Red">Red</a></li><li><a href="#variant.Rgb">Rgb</a></li><li><a href="#variant.White">White</a></li><li><a href="#variant.Yellow">Yellow</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.blink">blink</a></li><li><a href="#method.bold">bold</a></li><li><a href="#method.dimmed">dimmed</a></li><li><a href="#method.hidden">hidden</a></li><li><a href="#method.infix">infix</a></li><li><a href="#method.italic">italic</a></li><li><a href="#method.normal">normal</a></li><li><a href="#method.on">on</a></li><li><a href="#method.paint">paint</a></li><li><a href="#method.prefix">prefix</a></li><li><a href="#method.reverse">reverse</a></li><li><a href="#method.strikethrough">strikethrough</a></li><li><a href="#method.suffix">suffix</a></li><li><a href="#method.underline">underline</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-Color">Clone</a></li><li><a href="#impl-Copy-for-Color">Copy</a></li><li><a href="#impl-Debug-for-Color">Debug</a></li><li><a href="#impl-Default-for-Color">Default</a></li><li><a href="#impl-From%3CColor%3E-for-Style">From<Color></a></li><li><a href="#impl-PartialEq-for-Color">PartialEq</a></li><li><a href="#impl-StructuralPartialEq-for-Color">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-Color">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Color">Send</a></li><li><a href="#impl-Sync-for-Color">Sync</a></li><li><a href="#impl-Unpin-for-Color">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Color">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-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-ToOwned-for-T">ToOwned</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></ul></section><h2><a href="index.html">In crate nu_ansi_term</a></h2></div></nav><div class="sidebar-resizer"></div>
|
||
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../nu_ansi_term/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Enum <a href="index.html">nu_ansi_term</a>::<wbr><a class="enum" href="#">Color</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/nu_ansi_term/style.rs.html#288-372">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub enum Color {
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 21 variants</span></summary> Black,
|
||
DarkGray,
|
||
Red,
|
||
LightRed,
|
||
Green,
|
||
LightGreen,
|
||
Yellow,
|
||
LightYellow,
|
||
Blue,
|
||
LightBlue,
|
||
Purple,
|
||
LightPurple,
|
||
Magenta,
|
||
LightMagenta,
|
||
Cyan,
|
||
LightCyan,
|
||
White,
|
||
LightGray,
|
||
Fixed(<a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>),
|
||
Rgb(<a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>, <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>, <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>),
|
||
Default,
|
||
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A color is one specific type of ANSI escape code, and can refer
|
||
to either the foreground or background color.</p>
|
||
<p>These use the standard numeric sequences.
|
||
See <a href="http://invisible-island.net/xterm/ctlseqs/ctlseqs.html">http://invisible-island.net/xterm/ctlseqs/ctlseqs.html</a></p>
|
||
</div></details><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Black" class="variant"><a href="#variant.Black" class="anchor">§</a><h3 class="code-header">Black</h3></section><div class="docblock"><p>Color #0 (foreground code <code>30</code>, background code <code>40</code>).</p>
|
||
<p>This is not necessarily the background color, and using it as one may
|
||
render the text hard to read on terminals with dark backgrounds.</p>
|
||
</div><section id="variant.DarkGray" class="variant"><a href="#variant.DarkGray" class="anchor">§</a><h3 class="code-header">DarkGray</h3></section><div class="docblock"><p>Color #0 (foreground code <code>90</code>, background code <code>100</code>).</p>
|
||
</div><section id="variant.Red" class="variant"><a href="#variant.Red" class="anchor">§</a><h3 class="code-header">Red</h3></section><div class="docblock"><p>Color #1 (foreground code <code>31</code>, background code <code>41</code>).</p>
|
||
</div><section id="variant.LightRed" class="variant"><a href="#variant.LightRed" class="anchor">§</a><h3 class="code-header">LightRed</h3></section><div class="docblock"><p>Color #1 (foreground code <code>91</code>, background code <code>101</code>).</p>
|
||
</div><section id="variant.Green" class="variant"><a href="#variant.Green" class="anchor">§</a><h3 class="code-header">Green</h3></section><div class="docblock"><p>Color #2 (foreground code <code>32</code>, background code <code>42</code>).</p>
|
||
</div><section id="variant.LightGreen" class="variant"><a href="#variant.LightGreen" class="anchor">§</a><h3 class="code-header">LightGreen</h3></section><div class="docblock"><p>Color #2 (foreground code <code>92</code>, background code <code>102</code>).</p>
|
||
</div><section id="variant.Yellow" class="variant"><a href="#variant.Yellow" class="anchor">§</a><h3 class="code-header">Yellow</h3></section><div class="docblock"><p>Color #3 (foreground code <code>33</code>, background code <code>43</code>).</p>
|
||
</div><section id="variant.LightYellow" class="variant"><a href="#variant.LightYellow" class="anchor">§</a><h3 class="code-header">LightYellow</h3></section><div class="docblock"><p>Color #3 (foreground code <code>93</code>, background code <code>103</code>).</p>
|
||
</div><section id="variant.Blue" class="variant"><a href="#variant.Blue" class="anchor">§</a><h3 class="code-header">Blue</h3></section><div class="docblock"><p>Color #4 (foreground code <code>34</code>, background code <code>44</code>).</p>
|
||
</div><section id="variant.LightBlue" class="variant"><a href="#variant.LightBlue" class="anchor">§</a><h3 class="code-header">LightBlue</h3></section><div class="docblock"><p>Color #4 (foreground code <code>94</code>, background code <code>104</code>).</p>
|
||
</div><section id="variant.Purple" class="variant"><a href="#variant.Purple" class="anchor">§</a><h3 class="code-header">Purple</h3></section><div class="docblock"><p>Color #5 (foreground code <code>35</code>, background code <code>45</code>).</p>
|
||
</div><section id="variant.LightPurple" class="variant"><a href="#variant.LightPurple" class="anchor">§</a><h3 class="code-header">LightPurple</h3></section><div class="docblock"><p>Color #5 (foreground code <code>95</code>, background code <code>105</code>).</p>
|
||
</div><section id="variant.Magenta" class="variant"><a href="#variant.Magenta" class="anchor">§</a><h3 class="code-header">Magenta</h3></section><div class="docblock"><p>Color #5 (foreground code <code>35</code>, background code <code>45</code>).</p>
|
||
</div><section id="variant.LightMagenta" class="variant"><a href="#variant.LightMagenta" class="anchor">§</a><h3 class="code-header">LightMagenta</h3></section><div class="docblock"><p>Color #5 (foreground code <code>95</code>, background code <code>105</code>).</p>
|
||
</div><section id="variant.Cyan" class="variant"><a href="#variant.Cyan" class="anchor">§</a><h3 class="code-header">Cyan</h3></section><div class="docblock"><p>Color #6 (foreground code <code>36</code>, background code <code>46</code>).</p>
|
||
</div><section id="variant.LightCyan" class="variant"><a href="#variant.LightCyan" class="anchor">§</a><h3 class="code-header">LightCyan</h3></section><div class="docblock"><p>Color #6 (foreground code <code>96</code>, background code <code>106</code>).</p>
|
||
</div><section id="variant.White" class="variant"><a href="#variant.White" class="anchor">§</a><h3 class="code-header">White</h3></section><div class="docblock"><p>Color #7 (foreground code <code>37</code>, background code <code>47</code>).</p>
|
||
<p>As above, this is not necessarily the foreground color, and may be
|
||
hard to read on terminals with light backgrounds.</p>
|
||
</div><section id="variant.LightGray" class="variant"><a href="#variant.LightGray" class="anchor">§</a><h3 class="code-header">LightGray</h3></section><div class="docblock"><p>Color #7 (foreground code <code>97</code>, background code <code>107</code>).</p>
|
||
</div><section id="variant.Fixed" class="variant"><a href="#variant.Fixed" class="anchor">§</a><h3 class="code-header">Fixed(<a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>)</h3></section><div class="docblock"><p>A color number from 0 to 255, for use in 256-color terminal
|
||
environments.</p>
|
||
<ul>
|
||
<li>colors 0 to 7 are the <code>Black</code> to <code>White</code> variants respectively.
|
||
These colors can usually be changed in the terminal emulator.</li>
|
||
<li>colors 8 to 15 are brighter versions of the eight colors above.
|
||
These can also usually be changed in the terminal emulator, or it
|
||
could be configured to use the original colors and show the text in
|
||
bold instead. It varies depending on the program.</li>
|
||
<li>colors 16 to 231 contain several palettes of bright colors,
|
||
arranged in six squares measuring six by six each.</li>
|
||
<li>colors 232 to 255 are shades of grey from black to white.</li>
|
||
</ul>
|
||
<p>It might make more sense to look at a <a href="https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg">color chart</a>.</p>
|
||
</div><section id="variant.Rgb" class="variant"><a href="#variant.Rgb" class="anchor">§</a><h3 class="code-header">Rgb(<a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>, <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>, <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>)</h3></section><div class="docblock"><p>A 24-bit Rgb color, as specified by ISO-8613-3.</p>
|
||
</div><section id="variant.Default" class="variant"><a href="#variant.Default" class="anchor">§</a><h3 class="code-header">Default</h3></section><div class="docblock"><p>The default color (foreground code <code>39</code>, background codr <code>49</code>).</p>
|
||
</div></div><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-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/ansi.rs.html#251-303">source</a><a href="#impl-Color" class="anchor">§</a><h3 class="code-header">impl <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.prefix" class="method"><a class="src rightside" href="../src/nu_ansi_term/ansi.rs.html#265-267">source</a><h4 class="code-header">pub fn <a href="#method.prefix" class="fn">prefix</a>(self) -> <a class="struct" href="ansi/struct.Prefix.html" title="struct nu_ansi_term::ansi::Prefix">Prefix</a></h4></section></summary><div class="docblock"><p>The prefix bytes for this color as a <code>Style</code>. These are the bytes
|
||
that tell the terminal to use a different color or font style.</p>
|
||
<p>See also <a href="struct.Style.html#method.prefix"><code>Style::prefix</code></a>.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color::Green;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"\x1b[0m"</span>,
|
||
Green.suffix().to_string());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.infix" class="method"><a class="src rightside" href="../src/nu_ansi_term/ansi.rs.html#283-285">source</a><h4 class="code-header">pub fn <a href="#method.infix" class="fn">infix</a>(self, next: <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a>) -> <a class="struct" href="ansi/struct.Infix.html" title="struct nu_ansi_term::ansi::Infix">Infix</a></h4></section></summary><div class="docblock"><p>The infix bytes between this color and <code>next</code> color. These are the bytes
|
||
that tell the terminal to use the <code>next</code> color, or to do nothing if
|
||
the two colors are equal.</p>
|
||
<p>See also <a href="struct.Style.html#method.infix"><code>Style::infix</code></a>.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color::{Red, Yellow};
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"\x1b[33m"</span>,
|
||
Red.infix(Yellow).to_string());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.suffix" class="method"><a class="src rightside" href="../src/nu_ansi_term/ansi.rs.html#300-302">source</a><h4 class="code-header">pub fn <a href="#method.suffix" class="fn">suffix</a>(self) -> <a class="struct" href="ansi/struct.Suffix.html" title="struct nu_ansi_term::ansi::Suffix">Suffix</a></h4></section></summary><div class="docblock"><p>The suffix for this color as a <code>Style</code>. These are the bytes that
|
||
tell the terminal to reset back to its normal color and font style.</p>
|
||
<p>See also <a href="struct.Style.html#method.suffix"><code>Style::suffix</code></a>.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color::Purple;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"\x1b[0m"</span>,
|
||
Purple.suffix().to_string());</code></pre></div>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Color-1" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#380-568">source</a><a href="#impl-Color-1" class="anchor">§</a><h3 class="code-header">impl <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.normal" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#391-396">source</a><h4 class="code-header">pub fn <a href="#method.normal" class="fn">normal</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color.</p>
|
||
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Red.normal();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"hi"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.bold" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#409-415">source</a><h4 class="code-header">pub fn <a href="#method.bold" class="fn">bold</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
bold property set.</p>
|
||
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Green.bold();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"hey"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.dimmed" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#428-434">source</a><h4 class="code-header">pub fn <a href="#method.dimmed" class="fn">dimmed</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
dimmed property set.</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Yellow.dimmed();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"sup"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.italic" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#447-453">source</a><h4 class="code-header">pub fn <a href="#method.italic" class="fn">italic</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
italic property set.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Blue.italic();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"greetings"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.underline" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#466-472">source</a><h4 class="code-header">pub fn <a href="#method.underline" class="fn">underline</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
underline property set.</p>
|
||
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Purple.underline();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"salutations"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.blink" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#485-491">source</a><h4 class="code-header">pub fn <a href="#method.blink" class="fn">blink</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
blink property set.</p>
|
||
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Cyan.blink();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"wazzup"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.reverse" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#504-510">source</a><h4 class="code-header">pub fn <a href="#method.reverse" class="fn">reverse</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
reverse property set.</p>
|
||
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Black.reverse();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"aloha"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.hidden" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#523-529">source</a><h4 class="code-header">pub fn <a href="#method.hidden" class="fn">hidden</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
hidden property set.</p>
|
||
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::White.hidden();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"ahoy"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.strikethrough" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#542-548">source</a><h4 class="code-header">pub fn <a href="#method.strikethrough" class="fn">strikethrough</a>(self) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
strikethrough property set.</p>
|
||
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Fixed(<span class="number">244</span>).strikethrough();
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"yo"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on" class="method"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#561-567">source</a><h4 class="code-header">pub fn <a href="#method.on" class="fn">on</a>(self, background: <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a>) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>Returns a <code>Style</code> with the foreground color set to this color and the
|
||
background color property set to the given color.</p>
|
||
<h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color;
|
||
|
||
<span class="kw">let </span>style = Color::Rgb(<span class="number">31</span>, <span class="number">31</span>, <span class="number">31</span>).on(Color::White);
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, style.paint(<span class="string">"eyyyy"</span>));</code></pre></div>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Color-2" class="impl"><a class="src rightside" href="../src/nu_ansi_term/display.rs.html#165-185">source</a><a href="#impl-Color-2" class="anchor">§</a><h3 class="code-header">impl <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.paint" class="method"><a class="src rightside" href="../src/nu_ansi_term/display.rs.html#175-184">source</a><h4 class="code-header">pub fn <a href="#method.paint" class="fn">paint</a><'a, I, S: 'a + <a class="trait" href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>>(
|
||
self,
|
||
input: I
|
||
) -> <a class="struct" href="struct.AnsiGenericString.html" title="struct nu_ansi_term::AnsiGenericString">AnsiGenericString</a><'a, S><div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.77.2/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a><'a, S>>,
|
||
<S as <a class="trait" href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" title="type alloc::borrow::ToOwned::Owned">Owned</a>: <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h4></section></summary><div class="docblock"><p>Paints the given text with this color, returning an ANSI string.
|
||
This is a short-cut so you don’t have to use <code>Blue.normal()</code> just
|
||
to get blue text.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::Color::Blue;
|
||
<span class="macro">println!</span>(<span class="string">"{}"</span>, Blue.paint(<span class="string">"da ba dee"</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-Clone-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#impl-Clone-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" 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/1.77.2/src/core/clone.rs.html#169">source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&Self</a>)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#impl-Debug-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.77.2/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.77.2/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#374-378">source</a><a href="#impl-Default-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#375-377">source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CColor%3E-for-Style" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#570-584">source</a><a href="#impl-From%3CColor%3E-for-Style" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a>> for <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></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="../src/nu_ansi_term/style.rs.html#581-583">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(color: <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a>) -> <a class="struct" href="struct.Style.html" title="struct nu_ansi_term::Style">Style</a></h4></section></summary><div class="docblock"><p>You can turn a <code>Color</code> into a <code>Style</code> with the foreground color set
|
||
with the <code>From</code> trait.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>nu_ansi_term::{Style, Color};
|
||
<span class="kw">let </span>green_foreground = Style::default().fg(Color::Green);
|
||
<span class="macro">assert_eq!</span>(green_foreground, Color::Green.normal());
|
||
<span class="macro">assert_eq!</span>(green_foreground, Color::Green.into());
|
||
<span class="macro">assert_eq!</span>(green_foreground, Style::from(Color::Green));</code></pre></div>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#impl-PartialEq-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.77.2/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/1.77.2/src/core/cmp.rs.html#242">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.77.2/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-Copy-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#impl-Copy-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section><section id="impl-StructuralPartialEq-for-Color" class="impl"><a class="src rightside" href="../src/nu_ansi_term/style.rs.html#283">source</a><a href="#impl-StructuralPartialEq-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</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-RefUnwindSafe-for-Color" class="impl"><a href="#impl-RefUnwindSafe-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section><section id="impl-Send-for-Color" class="impl"><a href="#impl-Send-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section><section id="impl-Sync-for-Color" class="impl"><a href="#impl-Sync-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section><section id="impl-Unpin-for-Color" class="impl"><a href="#impl-Unpin-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</a></h3></section><section id="impl-UnwindSafe-for-Color" class="impl"><a href="#impl-UnwindSafe-for-Color" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.Color.html" title="enum nu_ansi_term::Color">Color</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.77.2/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/1.77.2/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.77.2/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.77.2/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/1.77.2/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/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/1.77.2/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/1.77.2/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.77.2/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/1.77.2/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.77.2/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/1.77.2/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.77.2/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/1.77.2/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/1.77.2/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.77.2/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/1.77.2/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.77.2/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/1.77.2/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.77.2/src/core/convert/mod.rs.html#764">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/1.77.2/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-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#767">source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/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-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#747-749">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/1.77.2/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/1.77.2/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/1.77.2/src/core/convert/mod.rs.html#757">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/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/1.77.2/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-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.2/src/alloc/borrow.rs.html#83-85">source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.2/src/alloc/borrow.rs.html#88">source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.2/src/alloc/borrow.rs.html#92">source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.77.2/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></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.77.2/src/core/convert/mod.rs.html#804-806">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/1.77.2/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/1.77.2/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-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/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.77.2/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.77.2/src/core/convert/mod.rs.html#811">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.77.2/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/1.77.2/src/core/convert/mod.rs.html#789-791">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/1.77.2/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/1.77.2/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" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.77.2/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.77.2/src/core/convert/mod.rs.html#796">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.77.2/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></div></section></div></main></body></html> |