mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-18 00:38:14 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
1
clap/all.html
Normal file
1
clap/all.html
Normal file
File diff suppressed because one or more lines are too long
258
clap/builder/enum.ArgAction.html
Normal file
258
clap/builder/enum.ArgAction.html
Normal file
File diff suppressed because one or more lines are too long
22
clap/builder/enum.ArgPredicate.html
Normal file
22
clap/builder/enum.ArgPredicate.html
Normal file
File diff suppressed because one or more lines are too long
54
clap/builder/enum.Resettable.html
Normal file
54
clap/builder/enum.Resettable.html
Normal file
File diff suppressed because one or more lines are too long
69
clap/builder/enum.ValueHint.html
Normal file
69
clap/builder/enum.ValueHint.html
Normal file
File diff suppressed because one or more lines are too long
3
clap/builder/index.html
Normal file
3
clap/builder/index.html
Normal file
File diff suppressed because one or more lines are too long
1
clap/builder/sidebar-items.js
Normal file
1
clap/builder/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["ArgAction","ArgPredicate","Resettable","ValueHint"],"mod":["styling"],"struct":["Arg","ArgGroup","BoolValueParser","BoolishValueParser","Command","EnumValueParser","FalseyValueParser","MapValueParser","NonEmptyStringValueParser","OsStr","OsStringValueParser","PathBufValueParser","PossibleValue","PossibleValuesParser","RangedI64ValueParser","RangedU64ValueParser","Str","StringValueParser","StyledStr","Styles","TryMapValueParser","UnknownArgumentValueParser","ValueParser","ValueRange"],"trait":["IntoResettable","TypedValueParser","ValueParserFactory"]};
|
||||
2202
clap/builder/struct.Arg.html
Normal file
2202
clap/builder/struct.Arg.html
Normal file
File diff suppressed because one or more lines are too long
316
clap/builder/struct.ArgGroup.html
Normal file
316
clap/builder/struct.ArgGroup.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/struct.BoolValueParser.html
Normal file
46
clap/builder/struct.BoolValueParser.html
Normal file
File diff suppressed because one or more lines are too long
78
clap/builder/struct.BoolishValueParser.html
Normal file
78
clap/builder/struct.BoolishValueParser.html
Normal file
File diff suppressed because one or more lines are too long
1695
clap/builder/struct.Command.html
Normal file
1695
clap/builder/struct.Command.html
Normal file
File diff suppressed because one or more lines are too long
83
clap/builder/struct.EnumValueParser.html
Normal file
83
clap/builder/struct.EnumValueParser.html
Normal file
File diff suppressed because one or more lines are too long
74
clap/builder/struct.FalseyValueParser.html
Normal file
74
clap/builder/struct.FalseyValueParser.html
Normal file
File diff suppressed because one or more lines are too long
65
clap/builder/struct.MapValueParser.html
Normal file
65
clap/builder/struct.MapValueParser.html
Normal file
File diff suppressed because one or more lines are too long
68
clap/builder/struct.NonEmptyStringValueParser.html
Normal file
68
clap/builder/struct.NonEmptyStringValueParser.html
Normal file
File diff suppressed because one or more lines are too long
207
clap/builder/struct.OsStr.html
Normal file
207
clap/builder/struct.OsStr.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/struct.OsStringValueParser.html
Normal file
46
clap/builder/struct.OsStringValueParser.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/struct.PathBufValueParser.html
Normal file
46
clap/builder/struct.PathBufValueParser.html
Normal file
File diff suppressed because one or more lines are too long
79
clap/builder/struct.PossibleValue.html
Normal file
79
clap/builder/struct.PossibleValue.html
Normal file
File diff suppressed because one or more lines are too long
75
clap/builder/struct.PossibleValuesParser.html
Normal file
75
clap/builder/struct.PossibleValuesParser.html
Normal file
File diff suppressed because one or more lines are too long
91
clap/builder/struct.RangedI64ValueParser.html
Normal file
91
clap/builder/struct.RangedI64ValueParser.html
Normal file
File diff suppressed because one or more lines are too long
88
clap/builder/struct.RangedU64ValueParser.html
Normal file
88
clap/builder/struct.RangedU64ValueParser.html
Normal file
File diff suppressed because one or more lines are too long
1290
clap/builder/struct.Str.html
Normal file
1290
clap/builder/struct.Str.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/struct.StringValueParser.html
Normal file
46
clap/builder/struct.StringValueParser.html
Normal file
File diff suppressed because one or more lines are too long
39
clap/builder/struct.StyledStr.html
Normal file
39
clap/builder/struct.StyledStr.html
Normal file
File diff suppressed because one or more lines are too long
40
clap/builder/struct.Styles.html
Normal file
40
clap/builder/struct.Styles.html
Normal file
File diff suppressed because one or more lines are too long
66
clap/builder/struct.TryMapValueParser.html
Normal file
66
clap/builder/struct.TryMapValueParser.html
Normal file
File diff suppressed because one or more lines are too long
74
clap/builder/struct.UnknownArgumentValueParser.html
Normal file
74
clap/builder/struct.UnknownArgumentValueParser.html
Normal file
File diff suppressed because one or more lines are too long
332
clap/builder/struct.ValueParser.html
Normal file
332
clap/builder/struct.ValueParser.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/struct.ValueRange.html
Normal file
46
clap/builder/struct.ValueRange.html
Normal file
File diff suppressed because one or more lines are too long
64
clap/builder/styling/enum.AnsiColor.html
Normal file
64
clap/builder/styling/enum.AnsiColor.html
Normal file
File diff suppressed because one or more lines are too long
41
clap/builder/styling/enum.Color.html
Normal file
41
clap/builder/styling/enum.Color.html
Normal file
File diff suppressed because one or more lines are too long
2
clap/builder/styling/index.html
Normal file
2
clap/builder/styling/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!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="Terminal `Styles` for help and error output"><title>clap::builder::styling - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module styling</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In clap::<wbr>builder</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">clap</a>::<wbr><a href="../index.html">builder</a></span><h1>Module <span>styling</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/clap_builder/builder/mod.rs.html#26">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Terminal <a href="../struct.Styles.html" title="struct clap::builder::Styles"><code>Styles</code></a> for help and error output</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Ansi256Color.html" title="struct clap::builder::styling::Ansi256Color">Ansi256<wbr>Color</a></div><div class="desc docblock-short">256 (8-bit) color support</div></li><li><div class="item-name"><a class="struct" href="struct.EffectIter.html" title="struct clap::builder::styling::EffectIter">Effect<wbr>Iter</a></div><div class="desc docblock-short">Enumerate each enabled value in <a href="struct.Effects.html" title="struct clap::builder::styling::Effects"><code>Effects</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.Effects.html" title="struct clap::builder::styling::Effects">Effects</a></div><div class="desc docblock-short">A set of text effects</div></li><li><div class="item-name"><a class="struct" href="struct.Reset.html" title="struct clap::builder::styling::Reset">Reset</a></div><div class="desc docblock-short">Reset terminal formatting</div></li><li><div class="item-name"><a class="struct" href="struct.RgbColor.html" title="struct clap::builder::styling::RgbColor">RgbColor</a></div><div class="desc docblock-short">24-bit ANSI RGB color codes</div></li><li><div class="item-name"><a class="struct" href="struct.Style.html" title="struct clap::builder::styling::Style">Style</a></div><div class="desc docblock-short">ANSI Text styling</div></li><li><div class="item-name"><a class="struct" href="struct.Styles.html" title="struct clap::builder::styling::Styles">Styles</a></div><div class="desc docblock-short">Terminal styling definitions</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.AnsiColor.html" title="enum clap::builder::styling::AnsiColor">Ansi<wbr>Color</a></div><div class="desc docblock-short">Available 4-bit ANSI color palette codes</div></li><li><div class="item-name"><a class="enum" href="enum.Color.html" title="enum clap::builder::styling::Color">Color</a></div><div class="desc docblock-short">Any ANSI color code scheme</div></li></ul></section></div></main></body></html>
|
||||
1
clap/builder/styling/sidebar-items.js
Normal file
1
clap/builder/styling/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["AnsiColor","Color"],"struct":["Ansi256Color","EffectIter","Effects","Reset","RgbColor","Style","Styles"]};
|
||||
36
clap/builder/styling/struct.Ansi256Color.html
Normal file
36
clap/builder/styling/struct.Ansi256Color.html
Normal file
File diff suppressed because one or more lines are too long
223
clap/builder/styling/struct.EffectIter.html
Normal file
223
clap/builder/styling/struct.EffectIter.html
Normal file
File diff suppressed because one or more lines are too long
108
clap/builder/styling/struct.Effects.html
Normal file
108
clap/builder/styling/struct.Effects.html
Normal file
File diff suppressed because one or more lines are too long
27
clap/builder/styling/struct.Reset.html
Normal file
27
clap/builder/styling/struct.Reset.html
Normal file
File diff suppressed because one or more lines are too long
31
clap/builder/styling/struct.RgbColor.html
Normal file
31
clap/builder/styling/struct.RgbColor.html
Normal file
File diff suppressed because one or more lines are too long
100
clap/builder/styling/struct.Style.html
Normal file
100
clap/builder/styling/struct.Style.html
Normal file
File diff suppressed because one or more lines are too long
40
clap/builder/styling/struct.Styles.html
Normal file
40
clap/builder/styling/struct.Styles.html
Normal file
File diff suppressed because one or more lines are too long
13
clap/builder/trait.IntoResettable.html
Normal file
13
clap/builder/trait.IntoResettable.html
Normal file
File diff suppressed because one or more lines are too long
203
clap/builder/trait.TypedValueParser.html
Normal file
203
clap/builder/trait.TypedValueParser.html
Normal file
File diff suppressed because one or more lines are too long
46
clap/builder/trait.ValueParserFactory.html
Normal file
46
clap/builder/trait.ValueParserFactory.html
Normal file
File diff suppressed because one or more lines are too long
258
clap/enum.ArgAction.html
Normal file
258
clap/enum.ArgAction.html
Normal file
File diff suppressed because one or more lines are too long
39
clap/enum.ColorChoice.html
Normal file
39
clap/enum.ColorChoice.html
Normal file
File diff suppressed because one or more lines are too long
69
clap/enum.ValueHint.html
Normal file
69
clap/enum.ValueHint.html
Normal file
File diff suppressed because one or more lines are too long
55
clap/error/enum.ContextKind.html
Normal file
55
clap/error/enum.ContextKind.html
Normal file
File diff suppressed because one or more lines are too long
31
clap/error/enum.ContextValue.html
Normal file
31
clap/error/enum.ContextValue.html
Normal file
File diff suppressed because one or more lines are too long
211
clap/error/enum.ErrorKind.html
Normal file
211
clap/error/enum.ErrorKind.html
Normal file
File diff suppressed because one or more lines are too long
2
clap/error/index.html
Normal file
2
clap/error/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!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="Error reporting"><title>clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate clap</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">clap</a></span><h1>Module <span>error</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/clap_builder/lib.rs.html#41">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Error reporting</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">Default<wbr>Formatter</a></div><div class="desc docblock-short">Richly formatted error context</div></li><li><div class="item-name"><a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a></div><div class="desc docblock-short">Command Line Argument Parser Error</div></li><li><div class="item-name"><a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">Kind<wbr>Formatter</a></div><div class="desc docblock-short">Report <a href="enum.ErrorKind.html" title="enum clap::error::ErrorKind"><code>ErrorKind</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.RichFormatter.html" title="struct clap::error::RichFormatter">Rich<wbr>Formatter</a></div><div class="desc docblock-short">Richly formatted error context</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.ContextKind.html" title="enum clap::error::ContextKind">Context<wbr>Kind</a></div><div class="desc docblock-short">Semantics for a piece of error information</div></li><li><div class="item-name"><a class="enum" href="enum.ContextValue.html" title="enum clap::error::ContextValue">Context<wbr>Value</a></div><div class="desc docblock-short">A piece of error information</div></li><li><div class="item-name"><a class="enum" href="enum.ErrorKind.html" title="enum clap::error::ErrorKind">Error<wbr>Kind</a></div><div class="desc docblock-short">Command line argument parser kind of error</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">Error<wbr>Formatter</a></div><div class="desc docblock-short">Defines how to format an error for displaying to the user</div></li></ul><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.Result.html" title="type clap::error::Result">Result</a></div><div class="desc docblock-short">Short hand for <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> type</div></li></ul></section></div></main></body></html>
|
||||
1
clap/error/sidebar-items.js
Normal file
1
clap/error/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["ContextKind","ContextValue","ErrorKind"],"struct":["DefaultFormatter","Error","KindFormatter","RichFormatter"],"trait":["ErrorFormatter"],"type":["Result"]};
|
||||
13
clap/error/struct.DefaultFormatter.html
Normal file
13
clap/error/struct.DefaultFormatter.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!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="Richly formatted error context"><title>DefaultFormatter in clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Default<wbr>Formatter</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-ErrorFormatter-for-RichFormatter" title="ErrorFormatter">ErrorFormatter</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-RichFormatter" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-RichFormatter" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-RichFormatter" title="Send">Send</a></li><li><a href="#impl-Sync-for-RichFormatter" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-RichFormatter" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-RichFormatter" 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<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In clap::<wbr>error</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">clap</a>::<wbr><a href="index.html">error</a></span><h1>Struct <span class="struct">DefaultFormatter</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/clap_builder/error/format.rs.html#62">Source</a> </span></div><pre class="rust item-decl"><code><div class="code-attribute">#[non_exhaustive]</div>pub struct DefaultFormatter;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Richly formatted error context</p>
|
||||
<p>This follows the <a href="https://rustc-dev-guide.rust-lang.org/diagnostics.html#suggestion-style-guide">rustc diagnostic style guide</a>.</p>
|
||||
</div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ErrorFormatter-for-RichFormatter" class="impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#65">Source</a><a href="#impl-ErrorFormatter-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">ErrorFormatter</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.format_error" class="method trait-impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#66">Source</a><a href="#method.format_error" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ErrorFormatter.html#tymethod.format_error" class="fn">format_error</a>(error: &<a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a>) -> <a class="struct" href="../builder/struct.StyledStr.html" title="struct clap::builder::StyledStr">StyledStr</a></h4></section></summary><div class='docblock'>Stylize the error for the terminal</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-RichFormatter" class="impl"><a href="#impl-Freeze-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-RefUnwindSafe-for-RichFormatter" class="impl"><a href="#impl-RefUnwindSafe-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Send-for-RichFormatter" class="impl"><a href="#impl-Send-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Sync-for-RichFormatter" class="impl"><a href="#impl-Sync-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Unpin-for-RichFormatter" class="impl"><a href="#impl-Unpin-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-UnwindSafe-for-RichFormatter" class="impl"><a href="#impl-UnwindSafe-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</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.84.1/src/core/any.rs.html#138">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.84.1/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.84.1/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.84.1/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.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#209">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.84.1/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.84.1/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.84.1/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.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#217">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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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>
|
||||
98
clap/error/struct.Error.html
Normal file
98
clap/error/struct.Error.html
Normal file
File diff suppressed because one or more lines are too long
16
clap/error/struct.KindFormatter.html
Normal file
16
clap/error/struct.KindFormatter.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!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="Report `ErrorKind`"><title>KindFormatter in clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Kind<wbr>Formatter</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-ErrorFormatter-for-KindFormatter" title="ErrorFormatter">ErrorFormatter</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-KindFormatter" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-KindFormatter" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-KindFormatter" title="Send">Send</a></li><li><a href="#impl-Sync-for-KindFormatter" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-KindFormatter" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-KindFormatter" 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<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In clap::<wbr>error</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">clap</a>::<wbr><a href="index.html">error</a></span><h1>Struct <span class="struct">KindFormatter</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/clap_builder/error/format.rs.html#36">Source</a> </span></div><pre class="rust item-decl"><code><div class="code-attribute">#[non_exhaustive]</div>pub struct KindFormatter;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Report <a href="enum.ErrorKind.html" title="enum clap::error::ErrorKind"><code>ErrorKind</code></a></p>
|
||||
<p>No context is included.</p>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Consider removing the <code>error-context</code> default feature if using this to remove all
|
||||
overhead for <a href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter"><code>RichFormatter</code></a>.</p>
|
||||
</div></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ErrorFormatter-for-KindFormatter" class="impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#38">Source</a><a href="#impl-ErrorFormatter-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">ErrorFormatter</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.format_error" class="method trait-impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#39">Source</a><a href="#method.format_error" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ErrorFormatter.html#tymethod.format_error" class="fn">format_error</a>(error: &<a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a><<a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a>>) -> <a class="struct" href="../builder/struct.StyledStr.html" title="struct clap::builder::StyledStr">StyledStr</a></h4></section></summary><div class='docblock'>Stylize the error for the terminal</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-KindFormatter" class="impl"><a href="#impl-Freeze-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section><section id="impl-RefUnwindSafe-for-KindFormatter" class="impl"><a href="#impl-RefUnwindSafe-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section><section id="impl-Send-for-KindFormatter" class="impl"><a href="#impl-Send-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section><section id="impl-Sync-for-KindFormatter" class="impl"><a href="#impl-Sync-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section><section id="impl-Unpin-for-KindFormatter" class="impl"><a href="#impl-Unpin-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section><section id="impl-UnwindSafe-for-KindFormatter" class="impl"><a href="#impl-UnwindSafe-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</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.84.1/src/core/any.rs.html#138">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.84.1/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.84.1/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.84.1/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.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#209">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.84.1/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.84.1/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.84.1/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.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#217">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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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>
|
||||
13
clap/error/struct.RichFormatter.html
Normal file
13
clap/error/struct.RichFormatter.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!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="Richly formatted error context"><title>RichFormatter in clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Rich<wbr>Formatter</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-ErrorFormatter-for-RichFormatter" title="ErrorFormatter">ErrorFormatter</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-RichFormatter" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-RichFormatter" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-RichFormatter" title="Send">Send</a></li><li><a href="#impl-Sync-for-RichFormatter" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-RichFormatter" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-RichFormatter" 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<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In clap::<wbr>error</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">clap</a>::<wbr><a href="index.html">error</a></span><h1>Struct <span class="struct">RichFormatter</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/clap_builder/error/format.rs.html#62">Source</a> </span></div><pre class="rust item-decl"><code><div class="code-attribute">#[non_exhaustive]</div>pub struct RichFormatter;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Richly formatted error context</p>
|
||||
<p>This follows the <a href="https://rustc-dev-guide.rust-lang.org/diagnostics.html#suggestion-style-guide">rustc diagnostic style guide</a>.</p>
|
||||
</div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ErrorFormatter-for-RichFormatter" class="impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#65">Source</a><a href="#impl-ErrorFormatter-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">ErrorFormatter</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.format_error" class="method trait-impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#66">Source</a><a href="#method.format_error" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ErrorFormatter.html#tymethod.format_error" class="fn">format_error</a>(error: &<a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a>) -> <a class="struct" href="../builder/struct.StyledStr.html" title="struct clap::builder::StyledStr">StyledStr</a></h4></section></summary><div class='docblock'>Stylize the error for the terminal</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-RichFormatter" class="impl"><a href="#impl-Freeze-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-RefUnwindSafe-for-RichFormatter" class="impl"><a href="#impl-RefUnwindSafe-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Send-for-RichFormatter" class="impl"><a href="#impl-Send-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Sync-for-RichFormatter" class="impl"><a href="#impl-Sync-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-Unpin-for-RichFormatter" class="impl"><a href="#impl-Unpin-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-UnwindSafe-for-RichFormatter" class="impl"><a href="#impl-UnwindSafe-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</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.84.1/src/core/any.rs.html#138">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.84.1/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.84.1/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.84.1/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.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#209">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.84.1/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.84.1/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.84.1/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.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/borrow.rs.html#217">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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/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.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/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.84.1/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 class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/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.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/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>
|
||||
6
clap/error/trait.ErrorFormatter.html
Normal file
6
clap/error/trait.ErrorFormatter.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<!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="Defines how to format an error for displaying to the user"><title>ErrorFormatter in clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Error<wbr>Formatter</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.format_error" title="format_error">format_error</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 clap::<wbr>error</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">clap</a>::<wbr><a href="index.html">error</a></span><h1>Trait <span class="trait">ErrorFormatter</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/clap_builder/error/format.rs.html#20">Source</a> </span></div><pre class="rust item-decl"><code>pub trait ErrorFormatter: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
// Required method
|
||||
fn <a href="#tymethod.format_error" class="fn">format_error</a>(error: &<a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a><Self>) -> <a class="struct" href="../builder/struct.StyledStr.html" title="struct clap::builder::StyledStr">StyledStr</a>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Defines how to format an error for displaying to the user</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.format_error" class="method"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#22">Source</a><h4 class="code-header">fn <a href="#tymethod.format_error" class="fn">format_error</a>(error: &<a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a><Self>) -> <a class="struct" href="../builder/struct.StyledStr.html" title="struct clap::builder::StyledStr">StyledStr</a></h4></section></summary><div class="docblock"><p>Stylize the error for the terminal</p>
|
||||
</div></details></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.1/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"><section id="impl-ErrorFormatter-for-RichFormatter" class="impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#65">Source</a><a href="#impl-ErrorFormatter-for-RichFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">ErrorFormatter</a> for <a class="struct" href="struct.DefaultFormatter.html" title="struct clap::error::DefaultFormatter">RichFormatter</a></h3></section><section id="impl-ErrorFormatter-for-KindFormatter" class="impl"><a class="src rightside" href="../../src/clap_builder/error/format.rs.html#38">Source</a><a href="#impl-ErrorFormatter-for-KindFormatter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ErrorFormatter.html" title="trait clap::error::ErrorFormatter">ErrorFormatter</a> for <a class="struct" href="struct.KindFormatter.html" title="struct clap::error::KindFormatter">KindFormatter</a></h3></section></div><script src="../../trait.impl/clap_builder/error/format/trait.ErrorFormatter.js" data-ignore-extern-crates="clap_builder" async></script></section></div></main></body></html>
|
||||
7
clap/error/type.Result.html
Normal file
7
clap/error/type.Result.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Short hand for `Result` type"><title>Result in clap::error - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Result</a></h2><h3><a href="#aliased-type">Aliased type</a></h3><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Err" title="Err">Err</a></li><li><a href="#variant.Ok" title="Ok">Ok</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In clap::<wbr>error</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">clap</a>::<wbr><a href="index.html">error</a></span><h1>Type Alias <span class="type">Result</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/clap_builder/error/mod.rs.html#53">Source</a> </span></div><pre class="rust item-decl"><code>pub type Result<T, E = <a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a>> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, E>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Short hand for <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> type</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>enum Result<T, E = <a class="struct" href="struct.Error.html" title="struct clap::error::Error">Error</a>> {
|
||||
Ok(T),
|
||||
Err(E),
|
||||
}</code></pre><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Ok" class="variant"><a href="#variant.Ok" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Ok(T)</h3></section><div class="docblock"><p>Contains the success value</p>
|
||||
</div><section id="variant.Err" class="variant"><a href="#variant.Err" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Err(E)</h3></section><div class="docblock"><p>Contains the error value</p>
|
||||
</div></div><script src="../../type.impl/core/result/enum.Result.js" data-self-path="clap::error::Result" async></script></section></div></main></body></html>
|
||||
114
clap/index.html
Normal file
114
clap/index.html
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<!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="Command Line Argument Parser for Rust"><title>clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.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 mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#aspirations" title="Aspirations">Aspirations</a></li><li><a href="#example" title="Example">Example</a><ul><li><a href="#related-projects" title="Related Projects">Related Projects</a></li></ul></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>Crate <span>clap</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/clap/lib.rs.html#6-102">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><blockquote>
|
||||
<p><strong>Command Line Argument Parser for Rust</strong></p>
|
||||
</blockquote>
|
||||
<p>Quick Links:</p>
|
||||
<ul>
|
||||
<li>Derive [tutorial][_derive::_tutorial::chapter_0] and [reference][_derive]</li>
|
||||
<li>Builder [tutorial][_tutorial::chapter_0] and <a href="index.html">reference</a></li>
|
||||
<li>[Cookbook][_cookbook]</li>
|
||||
<li>[FAQ][_faq]</li>
|
||||
<li><a href="https://github.com/clap-rs/clap/discussions">Discussions</a></li>
|
||||
<li><a href="https://github.com/clap-rs/clap/blob/v4.5.23/CHANGELOG.md">CHANGELOG</a> (includes major version migration
|
||||
guides)</li>
|
||||
</ul>
|
||||
<h3 id="aspirations"><a class="doc-anchor" href="#aspirations">§</a>Aspirations</h3>
|
||||
<ul>
|
||||
<li>Out of the box, users get a polished CLI experience
|
||||
<ul>
|
||||
<li>Including common argument behavior, help generation, suggested fixes for users, colored output, <a href="https://github.com/clap-rs/clap/tree/master/clap_complete">shell completions</a>, etc</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Flexible enough to port your existing CLI interface
|
||||
<ul>
|
||||
<li>However, we won’t necessarily streamline support for each use case</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Reasonable parse performance</li>
|
||||
<li>Resilient maintainership, including
|
||||
<ul>
|
||||
<li>Willing to break compatibility rather than batching up breaking changes in large releases</li>
|
||||
<li>Leverage feature flags to keep to one active branch</li>
|
||||
<li>Being under <a href="https://github.com/rust-cli/team/">WG-CLI</a> to increase the bus factor</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>We follow semver and will wait about 6-9 months between major breaking changes</li>
|
||||
<li>We will support the last two minor Rust releases (MSRV, currently 1.74)</li>
|
||||
</ul>
|
||||
<p>While these aspirations can be at odds with fast build times and low binary
|
||||
size, we will still strive to keep these reasonable for the flexibility you
|
||||
get. Check out the
|
||||
<a href="https://github.com/rust-cli/argparse-benchmarks-rs">argparse-benchmarks</a> for
|
||||
CLI parsers optimized for other use cases.</p>
|
||||
<h3 id="example"><a class="doc-anchor" href="#example">§</a>Example</h3>
|
||||
<p>Run</p>
|
||||
<div class="example-wrap"><pre class="language-console"><code>$ cargo add clap --features derive</code></pre></div>
|
||||
<p><em>(See also [feature flag reference][_features])</em></p>
|
||||
<p>Then define your CLI in <code>main.rs</code>:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>clap::Parser;
|
||||
|
||||
<span class="doccomment">/// Simple program to greet a person
|
||||
</span><span class="attr">#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = <span class="prelude-val">None</span>)]
|
||||
</span><span class="kw">struct </span>Args {
|
||||
<span class="doccomment">/// Name of the person to greet
|
||||
</span><span class="attr">#[arg(short, long)]
|
||||
</span>name: String,
|
||||
|
||||
<span class="doccomment">/// Number of times to greet
|
||||
</span><span class="attr">#[arg(short, long, default_value_t = <span class="number">1</span>)]
|
||||
</span>count: u8,
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>main() {
|
||||
<span class="kw">let </span>args = Args::parse();
|
||||
|
||||
<span class="kw">for _ in </span><span class="number">0</span>..args.count {
|
||||
<span class="macro">println!</span>(<span class="string">"Hello {}!"</span>, args.name);
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>And try it out:</p>
|
||||
<div class="example-wrap"><pre class="language-console"><code>$ demo --help
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
||||
Usage: demo[EXE] [OPTIONS] --name <NAME>
|
||||
|
||||
Options:
|
||||
-n, --name <NAME> Name of the person to greet
|
||||
-c, --count <COUNT> Number of times to greet [default: 1]
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ demo --name Me
|
||||
Hello Me!
|
||||
</code></pre></div>
|
||||
<p><em>(version number and <code>.exe</code> extension on windows replaced by placeholders)</em></p>
|
||||
<p>See also the derive [tutorial][_derive::_tutorial] and [reference][_derive]</p>
|
||||
<h4 id="related-projects"><a class="doc-anchor" href="#related-projects">§</a>Related Projects</h4>
|
||||
<p>Augment clap:</p>
|
||||
<ul>
|
||||
<li><a href="https://crates.io/crates/wild">wild</a> for supporting wildcards (<code>*</code>) on Windows like you do Linux</li>
|
||||
<li><a href="https://crates.io/crates/argfile">argfile</a> for loading additional arguments from a file (aka response files)</li>
|
||||
<li><a href="https://crates.io/crates/shadow-rs">shadow-rs</a> for generating <code>Command::long_version</code></li>
|
||||
<li><a href="https://crates.io/crates/clap_mangen">clap_mangen</a> for generating man page source (roff)</li>
|
||||
<li><a href="https://crates.io/crates/clap_complete">clap_complete</a> for shell completion support</li>
|
||||
</ul>
|
||||
<p>CLI Helpers</p>
|
||||
<ul>
|
||||
<li><a href="https://crates.io/crates/clio">clio</a> for reading/writing to files specified as arguments</li>
|
||||
<li><a href="https://crates.io/crates/clap-verbosity-flag">clap-verbosity-flag</a></li>
|
||||
<li><a href="https://crates.io/crates/clap-cargo">clap-cargo</a></li>
|
||||
<li><a href="https://crates.io/crates/concolor-clap">concolor-clap</a></li>
|
||||
</ul>
|
||||
<p>Testing</p>
|
||||
<ul>
|
||||
<li><a href="https://crates.io/crates/trycmd"><code>trycmd</code></a>: Bulk snapshot testing</li>
|
||||
<li><a href="https://crates.io/crates/snapbox"><code>snapbox</code></a>: Specialized snapshot testing</li>
|
||||
<li><a href="https://crates.io/crates/assert_cmd"><code>assert_cmd</code></a> and <a href="https://crates.io/crates/assert_fs"><code>assert_fs</code></a>: Customized testing</li>
|
||||
</ul>
|
||||
<p>Documentation:</p>
|
||||
<ul>
|
||||
<li><a href="https://rust-cli.github.io/book/index.html">Command-line Apps for Rust</a> book</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="builder/index.html" title="mod clap::builder">builder</a></div><div class="desc docblock-short">Define <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> line <a href="struct.Arg.html" title="struct clap::Arg">arguments</a></div></li><li><div class="item-name"><a class="mod" href="error/index.html" title="mod clap::error">error</a></div><div class="desc docblock-short">Error reporting</div></li><li><div class="item-name"><a class="mod" href="parser/index.html" title="mod clap::parser">parser</a></div><div class="desc docblock-short"><a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> line argument parser</div></li></ul><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="macro" href="macro.arg.html" title="macro clap::arg">arg</a></div><div class="desc docblock-short">Create an <a href="struct.Arg.html" title="struct clap::Arg"><code>Arg</code></a> from a usage string.</div></li><li><div class="item-name"><a class="macro" href="macro.command.html" title="macro clap::command">command</a></div><div class="desc docblock-short">Requires <code>cargo</code> feature flag to be enabled.</div></li><li><div class="item-name"><a class="macro" href="macro.value_parser.html" title="macro clap::value_parser">value_<wbr>parser</a></div><div class="desc docblock-short">Select a <a href="builder/struct.ValueParser.html" title="struct clap::builder::ValueParser"><code>ValueParser</code></a> implementation from the intended type</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Arg.html" title="struct clap::Arg">Arg</a></div><div class="desc docblock-short">The abstract representation of a command line argument. Used to set all the options and
|
||||
relationships that define a valid argument for the program.</div></li><li><div class="item-name"><a class="struct" href="struct.ArgGroup.html" title="struct clap::ArgGroup">ArgGroup</a></div><div class="desc docblock-short">Family of related <a href="struct.Arg.html" title="struct clap::Arg">arguments</a>.</div></li><li><div class="item-name"><a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a></div><div class="desc docblock-short">Container for parse results.</div></li><li><div class="item-name"><a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></div><div class="desc docblock-short">Build a command-line interface.</div></li><li><div class="item-name"><a class="struct" href="struct.Id.html" title="struct clap::Id">Id</a></div><div class="desc docblock-short"><a href="struct.Arg.html" title="struct clap::Arg"><code>Arg</code></a> or <a href="struct.ArgGroup.html" title="struct clap::ArgGroup"><code>ArgGroup</code></a> identifier</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.ArgAction.html" title="enum clap::ArgAction">ArgAction</a></div><div class="desc docblock-short">Behavior of arguments when they are encountered while parsing</div></li><li><div class="item-name"><a class="enum" href="enum.ColorChoice.html" title="enum clap::ColorChoice">Color<wbr>Choice</a></div><div class="desc docblock-short">Represents the color preferences for program output</div></li><li><div class="item-name"><a class="enum" href="enum.ValueHint.html" title="enum clap::ValueHint">Value<wbr>Hint</a></div><div class="desc docblock-short">Provide shell with hint on how to complete an argument.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.Args.html" title="trait clap::Args">Args</a></div><div class="desc docblock-short">Parse a set of arguments into a user-defined container.</div></li><li><div class="item-name"><a class="trait" href="trait.CommandFactory.html" title="trait clap::CommandFactory">Command<wbr>Factory</a></div><div class="desc docblock-short">Create a <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> relevant for a user-defined container.</div></li><li><div class="item-name"><a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">From<wbr>ArgMatches</a></div><div class="desc docblock-short">Converts an instance of <a href="struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a> to a user-defined container.</div></li><li><div class="item-name"><a class="trait" href="trait.Parser.html" title="trait clap::Parser">Parser</a></div><div class="desc docblock-short">Parse command-line arguments into <code>Self</code>.</div></li><li><div class="item-name"><a class="trait" href="trait.Subcommand.html" title="trait clap::Subcommand">Subcommand</a></div><div class="desc docblock-short">Parse a sub-command into a user-defined enum.</div></li><li><div class="item-name"><a class="trait" href="trait.ValueEnum.html" title="trait clap::ValueEnum">Value<wbr>Enum</a></div><div class="desc docblock-short">Parse arguments into enums.</div></li></ul><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.Error.html" title="type clap::Error">Error</a></div><div class="desc docblock-short">Command Line Argument Parser Error</div></li></ul></section></div></main></body></html>
|
||||
11
clap/macro.arg!.html
Normal file
11
clap/macro.arg!.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.arg.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.arg.html">macro.arg.html</a>...</p>
|
||||
<script>location.replace("macro.arg.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
66
clap/macro.arg.html
Normal file
66
clap/macro.arg.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!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="Create an `Arg` from a usage string."><title>arg in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">arg</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#syntax" title="Syntax">Syntax</a><ul><li><a href="#explicit-name" title="Explicit Name">Explicit Name</a></li><li><a href="#short" title="Short">Short</a></li><li><a href="#long" title="Long">Long</a></li><li><a href="#values-value-notation" title="Values (Value Notation)">Values (Value Notation)</a></li><li><a href="#" title="`...`"><code>...</code></a></li><li><a href="#help-string" title="Help String">Help String</a></li></ul></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate clap</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">clap</a></span><h1>Macro <span class="macro">arg</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/clap_builder/macros.rs.html#532">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! arg {
|
||||
( $name:ident: $($tail:tt)+ ) => { ... };
|
||||
( $($tail:tt)+ ) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create an <a href="struct.Arg.html" title="struct clap::Arg"><code>Arg</code></a> from a usage string.</p>
|
||||
<p>Allows creation of basic settings for the <a href="struct.Arg.html" title="struct clap::Arg"><code>Arg</code></a>.</p>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE</strong>: Not all settings may be set using the usage string method. Some properties are
|
||||
only available via the builder pattern.</p>
|
||||
</div>
|
||||
<h2 id="syntax"><a class="doc-anchor" href="#syntax">§</a>Syntax</h2>
|
||||
<p>Usage strings typically following the form:</p>
|
||||
<div class="example-wrap"><pre class="language-notrust"><code>[explicit name] [short] [long] [value names] [...] [help string]</code></pre></div><h4 id="explicit-name"><a class="doc-anchor" href="#explicit-name">§</a>Explicit Name</h4>
|
||||
<p>The name may be either a bare-word or a string, followed by a <code>:</code>, like <code>name:</code> or
|
||||
<code>"name":</code>.</p>
|
||||
<p><em>Note:</em> This is an optional field, if it’s omitted the argument will use one of the additional
|
||||
fields as the name using the following priority order:</p>
|
||||
<ol>
|
||||
<li>Explicit Name</li>
|
||||
<li>Long</li>
|
||||
<li>Value Name</li>
|
||||
</ol>
|
||||
<p>See <a href="struct.Arg.html#method.id" title="method clap::Arg::id"><code>Arg::id</code></a>.</p>
|
||||
<h4 id="short"><a class="doc-anchor" href="#short">§</a>Short</h4>
|
||||
<p>A short flag is a <code>-</code> followed by either a bare-character or quoted character, like <code>-f</code> or
|
||||
<code>-'f'</code>.</p>
|
||||
<p>See <a href="struct.Arg.html#method.short" title="method clap::Arg::short"><code>Arg::short</code></a>.</p>
|
||||
<h4 id="long"><a class="doc-anchor" href="#long">§</a>Long</h4>
|
||||
<p>A long flag is a <code>--</code> followed by either a bare-word or a string, like <code>--foo</code> or
|
||||
<code>--"foo"</code>.</p>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Dashes in the long name (e.g. <code>--foo-bar</code>) is not supported and quoting is required
|
||||
(e.g. <code>--"foo-bar"</code>).</p>
|
||||
</div>
|
||||
<p>See <a href="struct.Arg.html#method.long" title="method clap::Arg::long"><code>Arg::long</code></a>.</p>
|
||||
<h4 id="values-value-notation"><a class="doc-anchor" href="#values-value-notation">§</a>Values (Value Notation)</h4>
|
||||
<p>This is set by placing bare-word between:</p>
|
||||
<ul>
|
||||
<li><code>[]</code> like <code>[FOO]</code>
|
||||
<ul>
|
||||
<li>Positional argument: optional</li>
|
||||
<li>Named argument: optional value</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><code><></code> like <code><FOO></code>: required</li>
|
||||
</ul>
|
||||
<p>See <a href="struct.Arg.html#method.value_name" title="method clap::Arg::value_name"><code>Arg::value_name</code></a>.</p>
|
||||
<h4 id=""><a class="doc-anchor" href="#">§</a><code>...</code></h4>
|
||||
<p><code>...</code> (three consecutive dots/periods) specifies that this argument may occur multiple
|
||||
times (not to be confused with multiple values per occurrence).</p>
|
||||
<p>See <a href="enum.ArgAction.html#variant.Count" title="variant clap::ArgAction::Count"><code>ArgAction::Count</code></a> and <a href="enum.ArgAction.html#variant.Append" title="variant clap::ArgAction::Append"><code>ArgAction::Append</code></a>.</p>
|
||||
<h4 id="help-string"><a class="doc-anchor" href="#help-string">§</a>Help String</h4>
|
||||
<p>The help string is denoted between a pair of double quotes <code>""</code> and may contain any
|
||||
characters.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>cmd = Command::new(<span class="string">"prog"</span>)
|
||||
.args(<span class="kw-2">&</span>[
|
||||
<span class="macro">arg!</span>(--config <FILE> <span class="string">"a required file for the configuration and no short"</span>),
|
||||
<span class="macro">arg!</span>(-d --debug ... <span class="string">"turns on debugging information and allows multiples"</span>),
|
||||
<span class="macro">arg!</span>([input] <span class="string">"an optional input file to use"</span>)
|
||||
]);
|
||||
|
||||
<span class="kw">let </span>m = cmd.try_get_matches_from([<span class="string">"prog"</span>, <span class="string">"--config"</span>, <span class="string">"file.toml"</span>]).unwrap();
|
||||
<span class="macro">assert_eq!</span>(m.get_one::<String>(<span class="string">"config"</span>).unwrap(), <span class="string">"file.toml"</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>m.get_one::<u8>(<span class="string">"debug"</span>).unwrap(), <span class="number">0</span>);
|
||||
<span class="macro">assert_eq!</span>(m.get_one::<String>(<span class="string">"input"</span>), <span class="prelude-val">None</span>);</code></pre></div>
|
||||
</div></details></section></div></main></body></html>
|
||||
11
clap/macro.command!.html
Normal file
11
clap/macro.command!.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.command.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.command.html">macro.command.html</a>...</p>
|
||||
<script>location.replace("macro.command.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
5
clap/macro.command.html
Normal file
5
clap/macro.command.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Requires `cargo` feature flag to be enabled."><title>command in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">clap</a></span><h1>Macro <span class="macro">command</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/clap_builder/macros.rs.html#155">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! command {
|
||||
() => { ... };
|
||||
($name:expr) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Requires <code>cargo</code> feature flag to be enabled.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
11
clap/macro.value_parser!.html
Normal file
11
clap/macro.value_parser!.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.value_parser.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.value_parser.html">macro.value_parser.html</a>...</p>
|
||||
<script>location.replace("macro.value_parser.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
49
clap/macro.value_parser.html
Normal file
49
clap/macro.value_parser.html
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<!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="Select a `ValueParser` implementation from the intended type"><title>value_parser in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">value_<wbr>parser</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate clap</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">clap</a></span><h1>Macro <span class="macro">value_parser</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/clap_builder/builder/value_parser.rs.html#2614">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! value_parser {
|
||||
($name:ty) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Select a <a href="builder/struct.ValueParser.html" title="struct clap::builder::ValueParser"><code>ValueParser</code></a> implementation from the intended type</p>
|
||||
<p>Supported types</p>
|
||||
<ul>
|
||||
<li><a href="builder/trait.ValueParserFactory.html" title="trait clap::builder::ValueParserFactory"><code>ValueParserFactory</code> types</a>, including
|
||||
<ul>
|
||||
<li><a href="builder/struct.ValueParser.html" title="struct clap::builder::ValueParser">Native types</a>: <code>bool</code>, <code>String</code>, <code>OsString</code>, <code>PathBuf</code></li>
|
||||
<li><a href="builder/struct.RangedI64ValueParser.html" title="struct clap::builder::RangedI64ValueParser">Ranged numeric types</a>: <code>u8</code>, <code>i8</code>, <code>u16</code>, <code>i16</code>, <code>u32</code>, <code>i32</code>, <code>u64</code>, <code>i64</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="trait.ValueEnum.html" title="trait clap::ValueEnum"><code>ValueEnum</code> types</a></li>
|
||||
<li><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From"><code>From<OsString></code> types</a> and <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From"><code>From<&OsStr></code> types</a></li>
|
||||
<li><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From"><code>From<String></code> types</a> and <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From"><code>From<&str></code> types</a></li>
|
||||
<li><a href="https://doc.rust-lang.org/1.84.1/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr"><code>FromStr</code> types</a>, including usize, isize</li>
|
||||
</ul>
|
||||
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
|
||||
<p>Usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>cmd = clap::Command::new(<span class="string">"raw"</span>)
|
||||
.arg(
|
||||
clap::Arg::new(<span class="string">"output"</span>)
|
||||
.value_parser(<span class="macro">clap::value_parser!</span>(PathBuf))
|
||||
.required(<span class="bool-val">true</span>)
|
||||
);
|
||||
|
||||
<span class="kw">let </span>m = cmd.try_get_matches_from_mut([<span class="string">"cmd"</span>, <span class="string">"file.txt"</span>]).unwrap();
|
||||
<span class="kw">let </span>port: <span class="kw-2">&</span>PathBuf = m.get_one(<span class="string">"output"</span>)
|
||||
.expect(<span class="string">"required"</span>);
|
||||
<span class="macro">assert_eq!</span>(port, Path::new(<span class="string">"file.txt"</span>));</code></pre></div>
|
||||
<p>Example mappings:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Built-in types
|
||||
</span><span class="kw">let </span>parser = <span class="macro">clap::value_parser!</span>(String);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{parser:?}"</span>), <span class="string">"ValueParser::string"</span>);
|
||||
<span class="kw">let </span>parser = <span class="macro">clap::value_parser!</span>(std::ffi::OsString);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{parser:?}"</span>), <span class="string">"ValueParser::os_string"</span>);
|
||||
<span class="kw">let </span>parser = <span class="macro">clap::value_parser!</span>(std::path::PathBuf);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{parser:?}"</span>), <span class="string">"ValueParser::path_buf"</span>);
|
||||
<span class="macro">clap::value_parser!</span>(u16).range(<span class="number">3000</span>..);
|
||||
<span class="macro">clap::value_parser!</span>(u64).range(<span class="number">3000</span>..);
|
||||
|
||||
<span class="comment">// FromStr types
|
||||
</span><span class="kw">let </span>parser = <span class="macro">clap::value_parser!</span>(usize);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{parser:?}"</span>), <span class="string">"_AnonymousValueParser(ValueParser::other(usize))"</span>);
|
||||
|
||||
<span class="comment">// ValueEnum types
|
||||
</span><span class="macro">clap::value_parser!</span>(ColorChoice);</code></pre></div>
|
||||
</div></details></section></div></main></body></html>
|
||||
25
clap/parser/enum.MatchesError.html
Normal file
25
clap/parser/enum.MatchesError.html
Normal file
File diff suppressed because one or more lines are too long
28
clap/parser/enum.ValueSource.html
Normal file
28
clap/parser/enum.ValueSource.html
Normal file
File diff suppressed because one or more lines are too long
2
clap/parser/index.html
Normal file
2
clap/parser/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!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="`Command` line argument parser"><title>clap::parser - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module parser</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate clap</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">clap</a></span><h1>Module <span>parser</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/clap_builder/lib.rs.html#42">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="../struct.Command.html" title="struct clap::Command"><code>Command</code></a> line argument parser</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.ArgMatches.html" title="struct clap::parser::ArgMatches">ArgMatches</a></div><div class="desc docblock-short">Container for parse results.</div></li><li><div class="item-name"><a class="struct" href="struct.IdsRef.html" title="struct clap::parser::IdsRef">IdsRef</a></div><div class="desc docblock-short">Iterate over <a href="../struct.Arg.html" title="struct clap::Arg"><code>Arg</code></a> and <a href="../struct.ArgGroup.html" title="struct clap::ArgGroup"><code>ArgGroup</code></a> <a href="../struct.Id.html" title="struct clap::Id"><code>Id</code></a>s via <a href="../struct.ArgMatches.html#method.ids" title="method clap::ArgMatches::ids"><code>ArgMatches::ids</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Indices.html" title="struct clap::parser::Indices">Indices</a></div><div class="desc docblock-short">Iterate over indices for where an argument appeared when parsing, via <a href="../struct.ArgMatches.html#method.indices_of" title="method clap::ArgMatches::indices_of"><code>ArgMatches::indices_of</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.RawValues.html" title="struct clap::parser::RawValues">RawValues</a></div><div class="desc docblock-short">Iterate over raw argument values via <a href="../struct.ArgMatches.html#method.get_raw" title="method clap::ArgMatches::get_raw"><code>ArgMatches::get_raw</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Values.html" title="struct clap::parser::Values">Values</a></div><div class="desc docblock-short">Iterate over multiple values for an argument via <a href="../struct.ArgMatches.html#method.remove_many" title="method clap::ArgMatches::remove_many"><code>ArgMatches::remove_many</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.ValuesRef.html" title="struct clap::parser::ValuesRef">Values<wbr>Ref</a></div><div class="desc docblock-short">Iterate over multiple values for an argument via <a href="../struct.ArgMatches.html#method.get_many" title="method clap::ArgMatches::get_many"><code>ArgMatches::get_many</code></a>.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.MatchesError.html" title="enum clap::parser::MatchesError">Matches<wbr>Error</a></div><div class="desc docblock-short">Violation of <a href="../struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a> assumptions</div></li><li><div class="item-name"><a class="enum" href="enum.ValueSource.html" title="enum clap::parser::ValueSource">Value<wbr>Source</a></div><div class="desc docblock-short">Origin of the argument’s value</div></li></ul></section></div></main></body></html>
|
||||
1
clap/parser/sidebar-items.js
Normal file
1
clap/parser/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["MatchesError","ValueSource"],"struct":["ArgMatches","IdsRef","Indices","RawValues","Values","ValuesRef"]};
|
||||
661
clap/parser/struct.ArgMatches.html
Normal file
661
clap/parser/struct.ArgMatches.html
Normal file
File diff suppressed because one or more lines are too long
245
clap/parser/struct.IdsRef.html
Normal file
245
clap/parser/struct.IdsRef.html
Normal file
File diff suppressed because one or more lines are too long
245
clap/parser/struct.Indices.html
Normal file
245
clap/parser/struct.Indices.html
Normal file
File diff suppressed because one or more lines are too long
249
clap/parser/struct.RawValues.html
Normal file
249
clap/parser/struct.RawValues.html
Normal file
File diff suppressed because one or more lines are too long
247
clap/parser/struct.Values.html
Normal file
247
clap/parser/struct.Values.html
Normal file
File diff suppressed because one or more lines are too long
252
clap/parser/struct.ValuesRef.html
Normal file
252
clap/parser/struct.ValuesRef.html
Normal file
File diff suppressed because one or more lines are too long
1
clap/sidebar-items.js
Normal file
1
clap/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["ArgAction","ColorChoice","ValueHint"],"macro":["arg","command","value_parser"],"mod":["builder","error","parser"],"struct":["Arg","ArgGroup","ArgMatches","Command","Id"],"trait":["Args","CommandFactory","FromArgMatches","Parser","Subcommand","ValueEnum"],"type":["Error"]};
|
||||
2202
clap/struct.Arg.html
Normal file
2202
clap/struct.Arg.html
Normal file
File diff suppressed because one or more lines are too long
316
clap/struct.ArgGroup.html
Normal file
316
clap/struct.ArgGroup.html
Normal file
File diff suppressed because one or more lines are too long
661
clap/struct.ArgMatches.html
Normal file
661
clap/struct.ArgMatches.html
Normal file
File diff suppressed because one or more lines are too long
1695
clap/struct.Command.html
Normal file
1695
clap/struct.Command.html
Normal file
File diff suppressed because one or more lines are too long
39
clap/struct.Id.html
Normal file
39
clap/struct.Id.html
Normal file
File diff suppressed because one or more lines are too long
28
clap/trait.Args.html
Normal file
28
clap/trait.Args.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<!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="Parse a set of arguments into a user-defined container."><title>Args in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Args</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.augment_args" title="augment_args">augment_args</a></li><li><a href="#tymethod.augment_args_for_update" title="augment_args_for_update">augment_args_for_update</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.group_id" title="group_id">group_id</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Args-for-Box%3CT%3E" title="Box<T>">Box<T></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 clap</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">clap</a></span><h1>Trait <span class="trait">Args</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/clap_builder/derive.rs.html#226">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Args: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">FromArgMatches</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.augment_args" class="fn">augment_args</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.augment_args_for_update" class="fn">augment_args_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
|
||||
// Provided method
|
||||
fn <a href="#method.group_id" class="fn">group_id</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Id.html" title="struct clap::Id">Id</a>> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parse a set of arguments into a user-defined container.</p>
|
||||
<p>Implementing this trait lets a parent container delegate argument parsing behavior to <code>Self</code>.
|
||||
with:</p>
|
||||
<ul>
|
||||
<li><code>#[command(flatten)] args: ChildArgs</code>: Attribute can only be used with struct fields that impl
|
||||
<code>Args</code>.</li>
|
||||
<li><code>Variant(ChildArgs)</code>: No attribute is used with enum variants that impl <code>Args</code>.</li>
|
||||
</ul>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Deriving requires the <code>derive</code> feature flag</p>
|
||||
</div></div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.augment_args" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#237">Source</a><h4 class="code-header">fn <a href="#tymethod.augment_args" class="fn">augment_args</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Append to <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> so it can instantiate <code>Self</code> via
|
||||
<a href="trait.FromArgMatches.html#method.from_arg_matches_mut" title="associated function clap::FromArgMatches::from_arg_matches_mut"><code>FromArgMatches::from_arg_matches_mut</code></a></p>
|
||||
<p>This is used to implement <code>#[command(flatten)]</code></p>
|
||||
<p>See also <a href="trait.CommandFactory.html#tymethod.command" title="associated function clap::CommandFactory::command"><code>CommandFactory::command</code></a>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.augment_args_for_update" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#244">Source</a><h4 class="code-header">fn <a href="#tymethod.augment_args_for_update" class="fn">augment_args_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Append to <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> so it can instantiate <code>self</code> via
|
||||
<a href="trait.FromArgMatches.html#method.update_from_arg_matches_mut" title="method clap::FromArgMatches::update_from_arg_matches_mut"><code>FromArgMatches::update_from_arg_matches_mut</code></a></p>
|
||||
<p>This is used to implement <code>#[command(flatten)]</code></p>
|
||||
<p>See also <a href="trait.CommandFactory.html#tymethod.command_for_update" title="associated function clap::CommandFactory::command_for_update"><code>CommandFactory::command_for_update</code></a>.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.group_id" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#228">Source</a><h4 class="code-header">fn <a href="#method.group_id" class="fn">group_id</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Id.html" title="struct clap::Id">Id</a>></h4></section></summary><div class="docblock"><p>Report the <a href="struct.ArgGroup.html#method.id" title="method clap::ArgGroup::id"><code>ArgGroup::id</code></a> for this set of arguments</p>
|
||||
</div></details></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.1/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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Args-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#365">Source</a><a href="#impl-Args-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Args.html" title="trait clap::Args">Args</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.Args.html" title="trait clap::Args">Args</a>,</div></h3></section></summary><div class="impl-items"><section id="method.augment_args" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#366">Source</a><a href="#method.augment_args" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.augment_args" class="fn">augment_args</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section><section id="method.augment_args_for_update" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#369">Source</a><a href="#method.augment_args_for_update" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.augment_args_for_update" class="fn">augment_args_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/clap_builder/derive/trait.Args.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
|
||||
12
clap/trait.CommandFactory.html
Normal file
12
clap/trait.CommandFactory.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!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="Create a `Command` relevant for a user-defined container."><title>CommandFactory in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Command<wbr>Factory</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.command" title="command">command</a></li><li><a href="#tymethod.command_for_update" title="command_for_update">command_for_update</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-CommandFactory-for-Box%3CT%3E" title="Box<T>">Box<T></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 clap</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">clap</a></span><h1>Trait <span class="trait">CommandFactory</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/clap_builder/derive.rs.html#115">Source</a> </span></div><pre class="rust item-decl"><code>pub trait CommandFactory: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.command" class="fn">command</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.command_for_update" class="fn">command_for_update</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> relevant for a user-defined container.</p>
|
||||
<p>Derived as part of <a href="trait.Parser.html" title="trait clap::Parser"><code>Parser</code></a>.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.command" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#119">Source</a><h4 class="code-header">fn <a href="#tymethod.command" class="fn">command</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Build a <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> that can instantiate <code>Self</code>.</p>
|
||||
<p>See <a href="trait.FromArgMatches.html#method.from_arg_matches_mut" title="associated function clap::FromArgMatches::from_arg_matches_mut"><code>FromArgMatches::from_arg_matches_mut</code></a> for instantiating <code>Self</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.command_for_update" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#123">Source</a><h4 class="code-header">fn <a href="#tymethod.command_for_update" class="fn">command_for_update</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Build a <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> that can update <code>self</code>.</p>
|
||||
<p>See <a href="trait.FromArgMatches.html#method.update_from_arg_matches_mut" title="method clap::FromArgMatches::update_from_arg_matches_mut"><code>FromArgMatches::update_from_arg_matches_mut</code></a> for updating <code>self</code>.</p>
|
||||
</div></details></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.1/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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-CommandFactory-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#341">Source</a><a href="#impl-CommandFactory-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.CommandFactory.html" title="trait clap::CommandFactory">CommandFactory</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.CommandFactory.html" title="trait clap::CommandFactory">CommandFactory</a>,</div></h3></section></summary><div class="impl-items"><section id="method.command" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#342">Source</a><a href="#method.command" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.command" class="fn">command</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section><section id="method.command_for_update" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#345">Source</a><a href="#method.command_for_update" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.command_for_update" class="fn">command_for_update</a>() -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/clap_builder/derive/trait.CommandFactory.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
|
||||
62
clap/trait.FromArgMatches.html
Normal file
62
clap/trait.FromArgMatches.html
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<!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="Converts an instance of `ArgMatches` to a user-defined container."><title>FromArgMatches in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">From<wbr>ArgMatches</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_arg_matches" title="from_arg_matches">from_arg_matches</a></li><li><a href="#tymethod.update_from_arg_matches" title="update_from_arg_matches">update_from_arg_matches</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.from_arg_matches_mut" title="from_arg_matches_mut">from_arg_matches_mut</a></li><li><a href="#method.update_from_arg_matches_mut" title="update_from_arg_matches_mut">update_from_arg_matches_mut</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-FromArgMatches-for-Box%3CT%3E" title="Box<T>">Box<T></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 clap</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">clap</a></span><h1>Trait <span class="trait">FromArgMatches</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/clap_builder/derive.rs.html#129">Source</a> </span></div><pre class="rust item-decl"><code>pub trait FromArgMatches: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.from_arg_matches" class="fn">from_arg_matches</a>(matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.update_from_arg_matches" class="fn">update_from_arg_matches</a>(
|
||||
&mut self,
|
||||
matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>>;
|
||||
|
||||
// Provided methods
|
||||
fn <a href="#method.from_arg_matches_mut" class="fn">from_arg_matches_mut</a>(matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.update_from_arg_matches_mut" class="fn">update_from_arg_matches_mut</a>(
|
||||
&mut self,
|
||||
matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Converts an instance of <a href="struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a> to a user-defined container.</p>
|
||||
<p>Derived as part of <a href="trait.Parser.html" title="trait clap::Parser"><code>Parser</code></a>, <a href="trait.Args.html" title="trait clap::Args"><code>Args</code></a>, and <a href="trait.Subcommand.html" title="trait clap::Subcommand"><code>Subcommand</code></a>.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.from_arg_matches" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#164">Source</a><h4 class="code-header">fn <a href="#tymethod.from_arg_matches" class="fn">from_arg_matches</a>(matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Instantiate <code>Self</code> from <a href="struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a>, parsing the arguments as needed.</p>
|
||||
<p>Motivation: If our application had two CLI options, <code>--name <STRING></code> and the flag <code>--debug</code>, we may create a struct as follows:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">struct </span>Context {
|
||||
name: String,
|
||||
debug: bool
|
||||
}</code></pre></div>
|
||||
<p>We then need to convert the <code>ArgMatches</code> that <code>clap</code> generated into our struct.
|
||||
<code>from_arg_matches</code> serves as the equivalent of:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>From<ArgMatches> <span class="kw">for </span>Context {
|
||||
<span class="kw">fn </span>from(m: ArgMatches) -> <span class="self">Self </span>{
|
||||
Context {
|
||||
name: m.get_one::<String>(<span class="string">"name"</span>).unwrap().clone(),
|
||||
debug: m.get_flag(<span class="string">"debug"</span>),
|
||||
}
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.update_from_arg_matches" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#205">Source</a><h4 class="code-header">fn <a href="#tymethod.update_from_arg_matches" class="fn">update_from_arg_matches</a>(&mut self, matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Assign values from <code>ArgMatches</code> to <code>self</code>.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.from_arg_matches_mut" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#200">Source</a><h4 class="code-header">fn <a href="#method.from_arg_matches_mut" class="fn">from_arg_matches_mut</a>(matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Instantiate <code>Self</code> from <a href="struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a>, parsing the arguments as needed.</p>
|
||||
<p>Motivation: If our application had two CLI options, <code>--name <STRING></code> and the flag <code>--debug</code>, we may create a struct as follows:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">struct </span>Context {
|
||||
name: String,
|
||||
debug: bool
|
||||
}</code></pre></div>
|
||||
<p>We then need to convert the <code>ArgMatches</code> that <code>clap</code> generated into our struct.
|
||||
<code>from_arg_matches_mut</code> serves as the equivalent of:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>From<ArgMatches> <span class="kw">for </span>Context {
|
||||
<span class="kw">fn </span>from(m: ArgMatches) -> <span class="self">Self </span>{
|
||||
Context {
|
||||
name: m.get_one::<String>(<span class="string">"name"</span>).unwrap().to_string(),
|
||||
debug: m.get_flag(<span class="string">"debug"</span>),
|
||||
}
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.update_from_arg_matches_mut" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#208">Source</a><h4 class="code-header">fn <a href="#method.update_from_arg_matches_mut" class="fn">update_from_arg_matches_mut</a>(
|
||||
&mut self,
|
||||
matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Assign values from <code>ArgMatches</code> to <code>self</code>.</p>
|
||||
</div></details></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.1/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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-FromArgMatches-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#350">Source</a><a href="#impl-FromArgMatches-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">FromArgMatches</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">FromArgMatches</a>,</div></h3></section></summary><div class="impl-items"><section id="method.from_arg_matches" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#351">Source</a><a href="#method.from_arg_matches" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.from_arg_matches" class="fn">from_arg_matches</a>(matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section><section id="method.from_arg_matches_mut-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#354">Source</a><a href="#method.from_arg_matches_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.from_arg_matches_mut" class="fn">from_arg_matches_mut</a>(matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section><section id="method.update_from_arg_matches" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#357">Source</a><a href="#method.update_from_arg_matches" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.update_from_arg_matches" class="fn">update_from_arg_matches</a>(&mut self, matches: &<a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section><section id="method.update_from_arg_matches_mut-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#360">Source</a><a href="#method.update_from_arg_matches_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.update_from_arg_matches_mut" class="fn">update_from_arg_matches_mut</a>(
|
||||
&mut self,
|
||||
matches: &mut <a class="struct" href="struct.ArgMatches.html" title="struct clap::ArgMatches">ArgMatches</a>,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/clap_builder/derive/trait.FromArgMatches.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
|
||||
54
clap/trait.Parser.html
Normal file
54
clap/trait.Parser.html
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<!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="Parse command-line arguments into `Self`."><title>Parser in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Parser</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.parse" title="parse">parse</a></li><li><a href="#method.parse_from" title="parse_from">parse_from</a></li><li><a href="#method.try_parse" title="try_parse">try_parse</a></li><li><a href="#method.try_parse_from" title="try_parse_from">try_parse_from</a></li><li><a href="#method.try_update_from" title="try_update_from">try_update_from</a></li><li><a href="#method.update_from" title="update_from">update_from</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Parser-for-Box%3CT%3E" title="Box<T>">Box<T></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 clap</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">clap</a></span><h1>Trait <span class="trait">Parser</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/clap_builder/derive.rs.html#28">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Parser:
|
||||
<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>
|
||||
+ <a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">FromArgMatches</a>
|
||||
+ <a class="trait" href="trait.CommandFactory.html" title="trait clap::CommandFactory">CommandFactory</a> {
|
||||
// Provided methods
|
||||
fn <a href="#method.parse" class="fn">parse</a>() -> Self { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.try_parse" class="fn">try_parse</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.parse_from" class="fn">parse_from</a><I, T>(itr: I) -> Self
|
||||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.try_parse_from" class="fn">try_parse_from</a><I, T>(itr: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>>
|
||||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.update_from" class="fn">update_from</a><I, T>(&mut self, itr: I)
|
||||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.try_update_from" class="fn">try_update_from</a><I, T>(&mut self, itr: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>>
|
||||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parse command-line arguments into <code>Self</code>.</p>
|
||||
<p>The primary one-stop-shop trait used to create an instance of a <code>clap</code>
|
||||
<a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a>, conduct the parsing, and turn the resulting <a href="struct.ArgMatches.html" title="struct clap::ArgMatches"><code>ArgMatches</code></a> back
|
||||
into concrete instance of the user struct.</p>
|
||||
<p>This trait is primarily a convenience on top of <a href="trait.FromArgMatches.html" title="trait clap::FromArgMatches"><code>FromArgMatches</code></a> +
|
||||
<a href="trait.CommandFactory.html" title="trait clap::CommandFactory"><code>CommandFactory</code></a> which uses those two underlying traits to build the two
|
||||
fundamental functions <code>parse</code> which uses the <code>std::env::args_os</code> iterator,
|
||||
and <code>parse_from</code> which allows the consumer to supply the iterator (along
|
||||
with fallible options for each).</p>
|
||||
<p>See also <a href="trait.Subcommand.html" title="trait clap::Subcommand"><code>Subcommand</code></a> and <a href="trait.Args.html" title="trait clap::Args"><code>Args</code></a>.</p>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Deriving requires the <code>derive</code> feature flag</p>
|
||||
</div></div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.parse" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#30">Source</a><h4 class="code-header">fn <a href="#method.parse" class="fn">parse</a>() -> Self</h4></section></summary><div class="docblock"><p>Parse from <code>std::env::args_os()</code>, <a href="error/struct.Error.html#method.exit" title="method clap::error::Error::exit">exit</a> on error.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_parse" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#45">Source</a><h4 class="code-header">fn <a href="#method.try_parse" class="fn">try_parse</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Parse from <code>std::env::args_os()</code>, return Err on error.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.parse_from" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#51-54">Source</a><h4 class="code-header">fn <a href="#method.parse_from" class="fn">parse_from</a><I, T>(itr: I) -> Self<div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Parse from iterator, <a href="error/struct.Error.html#method.exit" title="method clap::error::Error::exit">exit</a> on error.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_parse_from" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#70-73">Source</a><h4 class="code-header">fn <a href="#method.try_parse_from" class="fn">try_parse_from</a><I, T>(itr: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>><div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Parse from iterator, return Err on error.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.update_from" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#84-87">Source</a><h4 class="code-header">fn <a href="#method.update_from" class="fn">update_from</a><I, T>(&mut self, itr: I)<div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Update from iterator, <a href="error/struct.Error.html#method.exit" title="method clap::error::Error::exit">exit</a> on error.</p>
|
||||
<p>Unlike <a href="trait.Parser.html#method.parse" title="associated function clap::Parser::parse"><code>Parser::parse</code></a>, this works with an existing instance of <code>self</code>.
|
||||
The assumption is that all required fields are already provided and any <a href="trait.Args.html" title="trait clap::Args"><code>Args</code></a> or
|
||||
<a href="trait.Subcommand.html" title="trait clap::Subcommand"><code>Subcommand</code></a>s provided by the user will modify only what is specified.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_update_from" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#100-103">Source</a><h4 class="code-header">fn <a href="#method.try_update_from" class="fn">try_update_from</a><I, T>(&mut self, itr: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>><div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Update from iterator, return Err on error.</p>
|
||||
</div></details></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.1/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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Parser-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#315">Source</a><a href="#impl-Parser-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Parser.html" title="trait clap::Parser">Parser</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.Parser.html" title="trait clap::Parser">Parser</a>,</div></h3></section></summary><div class="impl-items"><section id="method.parse-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#316">Source</a><a href="#method.parse-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.parse" class="fn">parse</a>() -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T></h4></section><section id="method.try_parse-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#320">Source</a><a href="#method.try_parse-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_parse" class="fn">try_parse</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>></h4></section><section id="method.parse_from-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#324-327">Source</a><a href="#method.parse_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.parse_from" class="fn">parse_from</a><I, It>(itr: I) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = It>,
|
||||
It: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section><section id="method.try_parse_from-1" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#332-335">Source</a><a href="#method.try_parse_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_parse_from" class="fn">try_parse_from</a><I, It>(itr: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>, <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>><div class="where">where
|
||||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = It>,
|
||||
It: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a>> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/clap_builder/derive/trait.Parser.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
|
||||
27
clap/trait.Subcommand.html
Normal file
27
clap/trait.Subcommand.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!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="Parse a sub-command into a user-defined enum."><title>Subcommand in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Subcommand</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.augment_subcommands" title="augment_subcommands">augment_subcommands</a></li><li><a href="#tymethod.augment_subcommands_for_update" title="augment_subcommands_for_update">augment_subcommands_for_update</a></li><li><a href="#tymethod.has_subcommand" title="has_subcommand">has_subcommand</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Subcommand-for-Box%3CT%3E" title="Box<T>">Box<T></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 clap</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">clap</a></span><h1>Trait <span class="trait">Subcommand</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/clap_builder/derive.rs.html#261">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Subcommand: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.FromArgMatches.html" title="trait clap::FromArgMatches">FromArgMatches</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.augment_subcommands" class="fn">augment_subcommands</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.augment_subcommands_for_update" class="fn">augment_subcommands_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.has_subcommand" class="fn">has_subcommand</a>(name: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parse a sub-command into a user-defined enum.</p>
|
||||
<p>Implementing this trait lets a parent container delegate subcommand behavior to <code>Self</code>.
|
||||
with:</p>
|
||||
<ul>
|
||||
<li><code>#[command(subcommand)] field: SubCmd</code>: Attribute can be used with either struct fields or enum
|
||||
variants that impl <code>Subcommand</code>.</li>
|
||||
<li><code>#[command(flatten)] Variant(SubCmd)</code>: Attribute can only be used with enum variants that impl
|
||||
<code>Subcommand</code>.</li>
|
||||
</ul>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Deriving requires the <code>derive</code> feature flag</p>
|
||||
</div></div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.augment_subcommands" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#268">Source</a><h4 class="code-header">fn <a href="#tymethod.augment_subcommands" class="fn">augment_subcommands</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Append to <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> so it can instantiate <code>Self</code> via
|
||||
<a href="trait.FromArgMatches.html#method.from_arg_matches_mut" title="associated function clap::FromArgMatches::from_arg_matches_mut"><code>FromArgMatches::from_arg_matches_mut</code></a></p>
|
||||
<p>This is used to implement <code>#[command(flatten)]</code></p>
|
||||
<p>See also <a href="trait.CommandFactory.html#tymethod.command" title="associated function clap::CommandFactory::command"><code>CommandFactory::command</code></a>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.augment_subcommands_for_update" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#275">Source</a><h4 class="code-header">fn <a href="#tymethod.augment_subcommands_for_update" class="fn">augment_subcommands_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section></summary><div class="docblock"><p>Append to <a href="struct.Command.html" title="struct clap::Command"><code>Command</code></a> so it can instantiate <code>self</code> via
|
||||
<a href="trait.FromArgMatches.html#method.update_from_arg_matches_mut" title="method clap::FromArgMatches::update_from_arg_matches_mut"><code>FromArgMatches::update_from_arg_matches_mut</code></a></p>
|
||||
<p>This is used to implement <code>#[command(flatten)]</code></p>
|
||||
<p>See also <a href="trait.CommandFactory.html#tymethod.command_for_update" title="associated function clap::CommandFactory::command_for_update"><code>CommandFactory::command_for_update</code></a>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.has_subcommand" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#277">Source</a><h4 class="code-header">fn <a href="#tymethod.has_subcommand" class="fn">has_subcommand</a>(name: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Test whether <code>Self</code> can parse a specific subcommand</p>
|
||||
</div></details></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.1/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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Subcommand-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#374">Source</a><a href="#impl-Subcommand-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Subcommand.html" title="trait clap::Subcommand">Subcommand</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.Subcommand.html" title="trait clap::Subcommand">Subcommand</a>,</div></h3></section></summary><div class="impl-items"><section id="method.augment_subcommands" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#375">Source</a><a href="#method.augment_subcommands" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.augment_subcommands" class="fn">augment_subcommands</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section><section id="method.augment_subcommands_for_update" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#378">Source</a><a href="#method.augment_subcommands_for_update" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.augment_subcommands_for_update" class="fn">augment_subcommands_for_update</a>(cmd: <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a>) -> <a class="struct" href="struct.Command.html" title="struct clap::Command">Command</a></h4></section><section id="method.has_subcommand" class="method trait-impl"><a class="src rightside" href="../src/clap_builder/derive.rs.html#381">Source</a><a href="#method.has_subcommand" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.has_subcommand" class="fn">has_subcommand</a>(name: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/clap_builder/derive/trait.Subcommand.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
|
||||
21
clap/trait.ValueEnum.html
Normal file
21
clap/trait.ValueEnum.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<!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="Parse arguments into enums."><title>ValueEnum in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Value<wbr>Enum</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.to_possible_value" title="to_possible_value">to_possible_value</a></li><li><a href="#tymethod.value_variants" title="value_variants">value_variants</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.from_str" title="from_str">from_str</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 clap</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">clap</a></span><h1>Trait <span class="trait">ValueEnum</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/clap_builder/derive.rs.html#292">Source</a> </span></div><pre class="rust item-decl"><code>pub trait ValueEnum: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.value_variants" class="fn">value_variants</a><'a>() -> &'a [Self];
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.to_possible_value" class="fn">to_possible_value</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="builder/struct.PossibleValue.html" title="struct clap::builder::PossibleValue">PossibleValue</a>>;
|
||||
|
||||
// Provided method
|
||||
fn <a href="#method.from_str" class="fn">from_str</a>(input: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>, ignore_case: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parse arguments into enums.</p>
|
||||
<p>When deriving <a href="trait.Parser.html" title="trait clap::Parser"><code>Parser</code></a>, a field whose type implements <code>ValueEnum</code> can have the attribute
|
||||
<code>#[arg(value_enum)]</code> which will</p>
|
||||
<ul>
|
||||
<li>Call <a href="builder/struct.EnumValueParser.html" title="struct clap::builder::EnumValueParser"><code>EnumValueParser</code></a></li>
|
||||
<li>Allowing using the <code>#[arg(default_value_t)]</code> attribute without implementing <code>Display</code>.</li>
|
||||
</ul>
|
||||
<div class="warning">
|
||||
<p><strong>NOTE:</strong> Deriving requires the <code>derive</code> feature flag</p>
|
||||
</div></div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.value_variants" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#294">Source</a><h4 class="code-header">fn <a href="#tymethod.value_variants" class="fn">value_variants</a><'a>() -> &'a [Self]</h4></section></summary><div class="docblock"><p>All possible argument values, in display order.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.to_possible_value" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#312">Source</a><h4 class="code-header">fn <a href="#tymethod.to_possible_value" class="fn">to_possible_value</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="builder/struct.PossibleValue.html" title="struct clap::builder::PossibleValue">PossibleValue</a>></h4></section></summary><div class="docblock"><p>The canonical argument value.</p>
|
||||
<p>The value is <code>None</code> for skipped variants.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.from_str" class="method"><a class="src rightside" href="../src/clap_builder/derive.rs.html#297">Source</a><h4 class="code-header">fn <a href="#method.from_str" class="fn">from_str</a>(input: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>, ignore_case: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>Parse an argument into <code>Self</code>.</p>
|
||||
</div></details></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.1/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"><section id="impl-ValueEnum-for-ColorChoice" class="impl"><a class="src rightside" href="../src/clap_builder/util/color.rs.html#96">Source</a><a href="#impl-ValueEnum-for-ColorChoice" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ValueEnum.html" title="trait clap::ValueEnum">ValueEnum</a> for <a class="enum" href="enum.ColorChoice.html" title="enum clap::ColorChoice">ColorChoice</a></h3></section></div><script src="../trait.impl/clap_builder/derive/trait.ValueEnum.js" data-ignore-extern-crates="clap_builder" async></script></section></div></main></body></html>
|
||||
3
clap/type.Error.html
Normal file
3
clap/type.Error.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Command Line Argument Parser Error"><title>Error in clap - 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="clap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" 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 type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../clap/index.html"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><h2><a href="../clap/index.html">clap</a><span class="version">4.5.23</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Error</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate clap</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">clap</a></span><h1>Type Alias <span class="type">Error</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/clap_builder/lib.rs.html#30">Source</a> </span></div><pre class="rust item-decl"><code>pub type Error = <a class="struct" href="error/struct.Error.html" title="struct clap::error::Error">Error</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Command Line Argument Parser Error</p>
|
||||
<p>See <a href="struct.Command.html#method.error" title="method clap::Command::error"><code>Command::error</code></a> to create an error.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct Error { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/clap/error/struct.Error.js" data-self-path="clap::Error" async></script></section></div></main></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue