<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `App` struct in crate `clap`."><metaname="keywords"content="rust, rustlang, rust-lang, App"><title>clap::App - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptsrc="../storage.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="shortcut icon"href="../favicon.ico"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../clap/index.html'><divclass='logo-container'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass='location'>Struct App</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#methods">Methods</a><divclass="sidebar-links"><ahref="#method.about">about</a><ahref="#method.after_help">after_help</a><ahref="#method.alias">alias</a><ahref="#method.aliases">aliases</a><ahref="#method.arg">arg</a><ahref="#method.arg_from_usage">arg_from_usage</a><ahref="#method.args">args</a><ahref="#method.args_from_usage">args_from_usage</a><ahref="#method.author">author</a><ahref="#method.before_help">before_help</a><ahref="#method.bin_name">bin_name</a><ahref="#method.display_order">display_order</a><ahref="#method.gen_completions">gen_completions</a><ahref="#method.gen_completions_to">gen_completions_to</a><ahref="#method.get_bin_name">get_bin_name</a><ahref="#method.get_matches">get_matches</a><ahref="#method.get_matches_from">get_matches_from</a><ahref="#method.get_matches_from_safe">get_matches_from_safe</a><ahref="#method.get_matches_from_safe_borrow">get_matches_from_safe_borrow</a><ahref="#method.get_matches_safe">get_matches_safe</a><ahref="#method.get_name">get_name</a><ahref="#method.global_setting">global_setting</a><ahref="#method.global_settings">global_settings</a><ahref="#method.group">group</a><ahref="#method.groups">groups</a><ahref="#method.help">help</a><ahref="#method.help_message">help_message</a><ahref="#method.help_short">help_short</a><ahref="#method.long_about">long_about</a><ahref="#method.long_version">long_version</a><ahref="#method.max_term_width">max_term_width</a><ahref="#method.name">name</a><ahref="#method.new">new</a><ahref="#method.print_help">print_help</a><ahref="#method.print_long_help">print_long_help</a><ahref="#method.set_term_width">set_term_width</a><ahref="#method.setting">setting</a><ahref="#method.settings">settings</a><ahref="#method.subcommand">subcommand</a><ahref="#method.subcommands">subcommands</a><ahref="#method.template">template</a><ahref="#method.unset_setting">unset_setting</a><ahref="#method.unset_settings">unset_settings</a><ahref="#method.usage">usage</a><ahref="#method.version">version</a><ahref="#method.version_message">version_message</a><ahref="#method.version_short">version_short</a><ahref="#method.visible_alias">visible_alias</a><ahref="#method.visible_aliases">visible_aliases</a><ahref="#method.with_defaults">with_defaults</a><ahref="#method.write_help">write_help</a><ahref="#method.write_long_help">write_long_help</a><ahref="#method.write_long_version">write_long_version</a><ahref="#method.write_version">write_version</a></div><aclass="sidebar-title"href="#implementations">Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-Clone">Clone</a><ahref="#impl-Display">Display</a></div><aclass="sidebar-title"href="#synthetic-implementations">Auto Trait Implementations</a><divc
arguments. Application settings are set using the "builder pattern" with the
<ahref="./struct.App.html#method.get_matches"><code>App::get_matches</code></a> family of methods being the terminal methods that starts the
runtime-parsing process. These methods then return information about the user supplied
arguments (or lack there of).</p>
<p><strong>NOTE:</strong> There aren't any mandatory "options" that one must set. The "options" may
also appear in any order (so long as one of the <ahref="./struct.App.html#method.get_matches"><code>App::get_matches</code></a> methods is the last method
.<spanclass="ident">after_help</span>(<spanclass="string">"Longer explanation to appear after the options when \
displaying the help information from --help or -h"</span>)
.<spanclass="ident">get_matches</span>();
<spanclass="comment">// Your program logic starts here...</span></pre></div>
</div><h2id='methods'class='small-section-header'>Methods<ahref='#methods'class='anchor'></a></h2><h3id='impl'class='impl'><codeclass='in-band'>impl<'a, 'b><aclass="struct"href="../clap/struct.App.html"title="struct clap::App">App</a><'a, 'b></code><ahref='#impl'class='anchor'></a><aclass='srclink'href='../src/clap/app/mod.rs.html#68-1638'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.new'class="method"><codeid='new.v'>pub fn <ahref='#method.new'class='fnname'>new</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(n: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#80-84'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Creates a new instance of an application requiring a name. The name may be, but doesn't
have to be same as the binary. The name will be displayed to the user when they request to
</div><h4id='method.get_name'class="method"><codeid='get_name.v'>pub fn <ahref='#method.get_name'class='fnname'>get_name</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><aclass='srclink'href='../src/clap/app/mod.rs.html#87'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Get the name of the app</p>
</div><h4id='method.get_bin_name'class="method"><codeid='get_bin_name.v'>pub fn <ahref='#method.get_bin_name'class='fnname'>get_bin_name</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#90'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Get the name of the binary</p>
</div><h4id='method.with_defaults'class="method"><codeid='with_defaults.v'>pub fn <ahref='#method.with_defaults'class='fnname'>with_defaults</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(n: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#107-114'title='goto source code'>[src]</a></h4><divclass='stability'><divclass='stab deprecated'>Deprecated since 2.14.1: <p>Can never work; use explicit App::author() and App::version() calls instead</p>
</div></div><divclass='docblock'><p>Creates a new instance of an application requiring a name, but uses the <ahref="./macro.crate_authors!.html"><code>crate_authors!</code></a>
and <ahref="./macro.crate_version!.html"><code>crate_version!</code></a> macros to fill in the <ahref="./struct.App.html#method.author"><code>App::author</code></a> and <ahref="./struct.App.html#method.author"><code>App::version</code></a> fields.</p>
</div><h4id='method.author'class="method"><codeid='author.v'>pub fn <ahref='#method.author'class='fnname'>author</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, author: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#178-181'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a string of author(s) that will be displayed to the user when they
request the help information with <code>--help</code> or <code>-h</code>.</p>
<p><strong>Pro-tip:</strong> Use <code>clap</code>s convenience macro <ahref="./macro.crate_authors!.html"><code>crate_authors!</code></a> to automatically set your
application's author(s) to the same thing as your crate at compile time. See the <ahref="https://github.com/clap-rs/clap/tree/master/examples"><code>examples/</code></a>
directory for more information</p>
<p>See the <ahref="https://github.com/clap-rs/clap/tree/master/examples"><code>examples/</code></a>
</div><h4id='method.bin_name'class="method"><codeid='bin_name.v'>pub fn <ahref='#method.bin_name'class='fnname'>bin_name</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(self, name: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#201-204'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Overrides the system-determined binary name. This should only be used when absolutely
necessary, such as when the binary name for your application is misleading, or perhaps
<em>not</em> how the user should invoke your program.</p>
<p><strong>Pro-tip:</strong> When building things such as third party <code>cargo</code> subcommands, this setting
<strong>should</strong> be used!</p>
<p><strong>NOTE:</strong> This command <strong>should not</strong> be used for <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s.</p>
</div><h4id='method.about'class="method"><codeid='about.v'>pub fn <ahref='#method.about'class='fnname'>about</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, about: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#224-227'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a string describing what the program does. This will be displayed when displaying help
information with <code>-h</code>.</p>
<p><strong>NOTE:</strong> If only <code>about</code> is provided, and not <ahref="./struct.App.html#method.long_about"><code>App::long_about</code></a> but the user requests
<code>--help</code> clap will still display the contents of <code>about</code> appropriately</p>
<p><strong>NOTE:</strong> Only <ahref="../clap/struct.App.html#method.about"title="`App::about`"><code>App::about</code></a> is used in completion script generation in order to be
.<spanclass="ident">about</span>(<spanclass="string">"Does really amazing things to great people"</span>)</pre></div>
</div><h4id='method.long_about'class="method"><codeid='long_about.v'>pub fn <ahref='#method.long_about'class='fnname'>long_about</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, about: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#250-253'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a string describing what the program does. This will be displayed when displaying help
information.</p>
<p><strong>NOTE:</strong> If only <code>long_about</code> is provided, and not <ahref="./struct.App.html#method.about"><code>App::about</code></a> but the user requests
<code>-h</code> clap will still display the contents of <code>long_about</code> appropriately</p>
<p><strong>NOTE:</strong> Only <ahref="./struct.App.html#method.about"><code>App::about</code></a> is used in completion script generation in order to be
<spanclass="string">"Does really amazing things to great people. Now let's talk a little
more in depth about how this subcommand really works. It may take about
a few lines of text, but that's ok!"</span>)</pre></div>
</div><h4id='method.name'class="method"><codeid='name.v'>pub fn <ahref='#method.name'class='fnname'>name</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(self, name: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#277-280'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the program's name. This will be displayed when displaying help information.</p>
<p><strong>Pro-top:</strong> This function is particularly useful when configuring a program via
<ahref="./struct.App.html#method.from_yaml"><code>App::from_yaml</code></a> in conjunction with the <ahref="./macro.crate_name.html"><code>crate_name!</code></a> macro to derive the program's
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
<spanclass="comment">// continued logic goes here, such as `app.get_matches()` etc.</span></pre></div>
</div><h4id='method.after_help'class="method"><codeid='after_help.v'>pub fn <ahref='#method.after_help'class='fnname'>after_help</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, help: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#294-297'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds additional help information to be displayed in addition to auto-generated help. This
information is displayed <strong>after</strong> the auto-generated help information. This is often used
to describe how to use the arguments, or caveats to be noted.</p>
.<spanclass="ident">after_help</span>(<spanclass="string">"Does really amazing things to great people...but be careful with -R"</span>)</pre></div>
</div><h4id='method.before_help'class="method"><codeid='before_help.v'>pub fn <ahref='#method.before_help'class='fnname'>before_help</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, help: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#311-314'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds additional help information to be displayed in addition to auto-generated help. This
information is displayed <strong>before</strong> the auto-generated help information. This is often used
.<spanclass="ident">before_help</span>(<spanclass="string">"Some info I'd like to appear before the help info"</span>)</pre></div>
</div><h4id='method.version'class="method"><codeid='version.v'>pub fn <ahref='#method.version'class='fnname'>version</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, ver: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#337-340'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a string of the version number to be displayed when displaying version or help
information with <code>-V</code>.</p>
<p><strong>NOTE:</strong> If only <code>version</code> is provided, and not <ahref="./struct.App.html#method.long_version"><code>App::long_version</code></a> but the user
requests <code>--version</code> clap will still display the contents of <code>version</code> appropriately</p>
<p><strong>Pro-tip:</strong> Use <code>clap</code>s convenience macro <ahref="./macro.crate_version!.html"><code>crate_version!</code></a> to automatically set your
application's version to the same thing as your crate at compile time. See the <ahref="https://github.com/clap-rs/clap/tree/master/examples"><code>examples/</code></a>
</div><h4id='method.long_version'class="method"><codeid='long_version.v'>pub fn <ahref='#method.long_version'class='fnname'>long_version</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, ver: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#368-371'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a string of the version number to be displayed when displaying version or help
information with <code>--version</code>.</p>
<p><strong>NOTE:</strong> If only <code>long_version</code> is provided, and not <ahref="./struct.App.html#method.version"><code>App::version</code></a> but the user
requests <code>-V</code> clap will still display the contents of <code>long_version</code> appropriately</p>
<p><strong>Pro-tip:</strong> Use <code>clap</code>s convenience macro <ahref="./macro.crate_version!.html"><code>crate_version!</code></a> to automatically set your
application's version to the same thing as your crate at compile time. See the <ahref="https://github.com/clap-rs/clap/tree/master/examples"><code>examples/</code></a>
</div><h4id='method.help'class="method"><codeid='help.v'>pub fn <ahref='#method.help'class='fnname'>help</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, help: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#436-439'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a custom help message and overrides the auto-generated one. This should only be used
when the auto-generated message does not suffice.</p>
<p>This will be displayed to the user when they use <code>--help</code> or <code>-h</code></p>
<p><strong>NOTE:</strong> This replaces the <strong>entire</strong> help message, so nothing will be auto-generated.</p>
<p><strong>NOTE:</strong> This <strong>only</strong> replaces the help message for the current command, meaning if you
are using subcommands, those help messages will still be auto-generated unless you
specify a <ahref="./struct.Arg.html#method.help"><code>Arg::help</code></a> for them as well.</p>
.<spanclass="ident">help_short</span>(<spanclass="string">"H"</span>) <spanclass="comment">// Using an uppercase `H` instead of the default lowercase `h`</span></pre></div>
</div><h4id='method.version_short'class="method"><codeid='version_short.v'>pub fn <ahref='#method.version_short'class='fnname'>version_short</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, s: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#488-491'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the <ahref="./struct.Arg.html#method.short"><code>short</code></a> for the auto-generated <code>version</code> argument.</p>
<p>By default <code>clap</code> automatically assigns <code>V</code>, but this can be overridden if you have a
different argument which you'd prefer to use the <code>-V</code> short with. This can be done by
defining your own argument with an uppercase <code>V</code> as the <ahref="./struct.Arg.html#method.short"><code>short</code></a>.</p>
<p><code>clap</code> lazily generates these <code>version</code> arguments <strong>after</strong> you've defined any arguments of
your own.</p>
<p><strong>NOTE:</strong> Any leading <code>-</code> characters will be stripped, and only the first
non <code>-</code> character will be used as the <code>short</code> version</p>
.<spanclass="ident">version_short</span>(<spanclass="string">"v"</span>) <spanclass="comment">// Using a lowercase `v` instead of the default capital `V`</span></pre></div>
</div><h4id='method.help_message'class="method"><codeid='help_message.v'>pub fn <ahref='#method.help_message'class='fnname'>help_message</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, s: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#508-511'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the help text for the auto-generated <code>help</code> argument.</p>
<p>By default <code>clap</code> sets this to <code>"Prints help information"</code>, but if you're using a
different convention for your help messages and would prefer a different phrasing you can
.<spanclass="ident">help_message</span>(<spanclass="string">"Print help information"</span>) <spanclass="comment">// Perhaps you want imperative help messages</span>
</pre></div>
</div><h4id='method.version_message'class="method"><codeid='version_message.v'>pub fn <ahref='#method.version_message'class='fnname'>version_message</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, s: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#526-529'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the help text for the auto-generated <code>version</code> argument.</p>
<p>By default <code>clap</code> sets this to <code>"Prints version information"</code>, but if you're using a
different convention for your help messages and would prefer a different phrasing then you
.<spanclass="ident">version_message</span>(<spanclass="string">"Print version information"</span>) <spanclass="comment">// Perhaps you want imperative help messages</span></pre></div>
</div><h4id='method.template'class="method"><codeid='template.v'>pub fn <ahref='#method.template'class='fnname'>template</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, s: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#570-573'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the help template to be used, overriding the default format.</p>
</div><h4id='method.global_setting'class="method"><codeid='global_setting.v'>pub fn <ahref='#method.global_setting'class='fnname'>global_setting</a>(self, setting: <aclass="enum"href="../clap/enum.AppSettings.html"title="enum clap::AppSettings">AppSettings</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#633-637'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Enables a single setting that is propagated down through all child <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s.</p>
<p>See <ahref="./enum.AppSettings.html"><code>AppSettings</code></a> for a full list of possibilities and examples.</p>
<p><strong>NOTE</strong>: The setting is <em>only</em> propagated <em>down</em> and not up through parent commands.</p>
</div><h4id='method.global_settings'class="method"><codeid='global_settings.v'>pub fn <ahref='#method.global_settings'class='fnname'>global_settings</a>(self, settings: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="enum"href="../clap/enum.AppSettings.html"title="enum clap::AppSettings">AppSettings</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#656-662'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Enables multiple settings which are propagated <em>down</em> through all child <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s.</p>
<p>See <ahref="./enum.AppSettings.html"><code>AppSettings</code></a> for a full list of possibilities and examples.</p>
<p><strong>NOTE</strong>: The setting is <em>only</em> propagated <em>down</em> and not up through parent commands.</p>
</div><h4id='method.set_term_width'class="method"><codeid='set_term_width.v'>pub fn <ahref='#method.set_term_width'class='fnname'>set_term_width</a>(self, width: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#730-733'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the terminal width at which to wrap help messages. Defaults to <code>120</code>. Using <code>0</code> will
ignore terminal widths and use source formatting.</p>
<p><code>clap</code> automatically tries to determine the terminal width on Unix, Linux, macOS and Windows
if the <code>wrap_help</code> cargo "feature" has been used while compiling. If the terminal width
cannot be determined, <code>clap</code> defaults to <code>120</code>.</p>
<p><strong>NOTE:</strong> This setting applies globally and <em>not</em> on a per-command basis.</p>
<p><strong>NOTE:</strong> This setting must be set <strong>before</strong> any subcommands are added!</p>
</div><h4id='method.max_term_width'class="method"><codeid='max_term_width.v'>pub fn <ahref='#method.max_term_width'class='fnname'>max_term_width</a>(self, w: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#758-761'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the max terminal width at which to wrap help messages. Using <code>0</code> will ignore terminal
widths and use source formatting.</p>
<p><code>clap</code> automatically tries to determine the terminal width on Unix, Linux, macOS and Windows
if the <code>wrap_help</code> cargo "feature" has been used while compiling, but one might want to
limit the size (e.g. when the terminal is running fullscreen).</p>
<p><strong>NOTE:</strong> This setting applies globally and <em>not</em> on a per-command basis.</p>
<p><strong>NOTE:</strong> This setting must be set <strong>before</strong> any subcommands are added!</p>
</div><h4id='method.arg'class="method"><codeid='arg.v'>pub fn <ahref='#method.arg'class='fnname'>arg</a><A: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="../clap/struct.Arg.html"title="struct clap::Arg">Arg</a><'a, 'b>>>(self, a: A) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#784-787'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds an <ahref="./struct.Arg.html">argument</a> to the list of valid possibilities.</p>
<spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"-c --config=[CONFIG] 'Optionally sets a config file to use'"</span>)
)</pre></div>
</div><h4id='method.args'class="method"><codeid='args.v'>pub fn <ahref='#method.args'class='fnname'>args</a>(self, args: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="struct"href="../clap/struct.Arg.html"title="struct clap::Arg">Arg</a><'a, 'b><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#803-808'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds multiple <ahref="./struct.Arg.html">arguments</a> to the list of valid possibilities</p>
<spanclass="kw-2">&</span>[<spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"[debug] -d 'turns on debugging info'"</span>),
<spanclass="ident">Arg</span>::<spanclass="ident">with_name</span>(<spanclass="string">"input"</span>).<spanclass="ident">index</span>(<spanclass="number">1</span>).<spanclass="ident">help</span>(<spanclass="string">"the input file to use"</span>)]
)</pre></div>
</div><h4id='method.arg_from_usage'class="method"><codeid='arg_from_usage.v'>pub fn <ahref='#method.arg_from_usage'class='fnname'>arg_from_usage</a>(self, usage: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#827-830'title='goto source code'>[src]</a></h4><divclass='docblock'><p>A convenience method for adding a single <ahref="./struct.Arg.html">argument</a> from a usage type string. The string
used follows the same rules and syntax as <ahref="./struct.Arg.html#method.from_usage"><code>Arg::from_usage</code></a></p>
<p><strong>NOTE:</strong> The downside to using this method is that you can not set any additional
properties of the <ahref="./struct.Arg.html"><code>Arg</code></a> other than what <ahref="./struct.Arg.html#method.from_usage"><code>Arg::from_usage</code></a> supports.</p>
.<spanclass="ident">arg_from_usage</span>(<spanclass="string">"-c --config=<FILE>'Sets a configuration file to use'"</span>)</pre></div>
</div><h4id='method.args_from_usage'class="method"><codeid='args_from_usage.v'>pub fn <ahref='#method.args_from_usage'class='fnname'>args_from_usage</a>(self, usage: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#854-863'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds multiple <ahref="./struct.Arg.html">arguments</a> at once from a usage string, one per line. See
<ahref="./struct.Arg.html#method.from_usage"><code>Arg::from_usage</code></a> for details on the syntax and rules supported.</p>
<p><strong>NOTE:</strong> Like <ahref="./struct.App.html#method.arg_from_usage"><code>App::arg_from_usage</code></a> the downside is you only set properties for the
<ahref="./struct.Arg.html"><code>Arg</code></a>s which <ahref="./struct.Arg.html#method.from_usage"><code>Arg::from_usage</code></a> supports.</p>
<spanclass="string">"-c --config=[FILE] 'Sets a configuration file to use'
[debug]... -d 'Sets the debugging level'
<FILE>'The input file to use'"</span>
)</pre></div>
</div><h4id='method.alias'class="method"><codeid='alias.v'>pub fn <ahref='#method.alias'class='fnname'>alias</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, name: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#881-888'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding a <ahref="./struct.SubCommand.html"><code>SubCommand</code></a> alias, which function as "hidden" subcommands that
automatically dispatch as if this subcommand was used. This is more efficient, and easier
than creating multiple hidden subcommands as one only needs to check for the existence of
</div><h4id='method.aliases'class="method"><codeid='aliases.v'>pub fn <ahref='#method.aliases'class='fnname'>aliases</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#910-919'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding <ahref="./struct.SubCommand.html"><code>SubCommand</code></a> aliases, which function as "hidden" subcommands that
automatically dispatch as if this subcommand was used. This is more efficient, and easier
than creating multiple hidden subcommands as one only needs to check for the existence of
</div><h4id='method.visible_alias'class="method"><codeid='visible_alias.v'>pub fn <ahref='#method.visible_alias'class='fnname'>visible_alias</a><S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(self, name: S) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#936-943'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding a <ahref="./struct.SubCommand.html"><code>SubCommand</code></a> alias that functions exactly like those defined with
<ahref="./struct.App.html#method.alias"><code>App::alias</code></a>, except that they are visible inside the help message.</p>
</div><h4id='method.visible_aliases'class="method"><codeid='visible_aliases.v'>pub fn <ahref='#method.visible_aliases'class='fnname'>visible_aliases</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#960-969'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding multiple <ahref="./struct.SubCommand.html"><code>SubCommand</code></a> aliases that functions exactly like those defined
with <ahref="./struct.App.html#method.aliases"><code>App::aliases</code></a>, except that they are visible inside the help message.</p>
</div><h4id='method.group'class="method"><codeid='group.v'>pub fn <ahref='#method.group'class='fnname'>group</a>(self, group: <aclass="struct"href="../clap/struct.ArgGroup.html"title="struct clap::ArgGroup">ArgGroup</a><'a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#1005-1008'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds an <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a> to the application. <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a>s are a family of related arguments.
By placing them in a logical group, you can build easier requirement and exclusion rules.
For instance, you can make an entire <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a> required, meaning that one (and <em>only</em>
one) argument from that group must be present at runtime.</p>
<p>You can also do things such as name an <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a> as a conflict to another argument.
Meaning any of the arguments that belong to that group will cause a failure if present with
the conflicting argument.</p>
<p>Another added benefit of <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a>s is that you can extract a value from a group instead
of determining exactly which argument was used.</p>
<p>Finally, using <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a>s to ensure exclusion between arguments is another very common
</div><h4id='method.subcommand'class="method"><codeid='subcommand.v'>pub fn <ahref='#method.subcommand'class='fnname'>subcommand</a>(self, subcmd: <aclass="struct"href="../clap/struct.App.html"title="struct clap::App">App</a><'a, 'b>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#1059-1062'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds a <ahref="./struct.SubCommand.html"><code>SubCommand</code></a> to the list of valid possibilities. Subcommands are effectively
sub-<ahref="./struct.App.html"><code>App</code></a>s, because they can contain their own arguments, subcommands, version, usage,
etc. They also function just like <ahref="./struct.App.html"><code>App</code></a>s, in that they get their own auto generated help,
.<spanclass="ident">arg_from_usage</span>(<spanclass="string">"<config>'Required configuration file to use'"</span>))</pre></div>
</div><h4id='method.subcommands'class="method"><codeid='subcommands.v'>pub fn <ahref='#method.subcommands'class='fnname'>subcommands</a><I>(self, subcmds: I) -> Self <spanclass="where fmt-newline">where<br> I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="struct"href="../clap/struct.App.html"title="struct clap::App">App</a><'a, 'b>>, </span></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1080-1088'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Adds multiple subcommands to the list of valid possibilities by iterating over an
<ahref="https://doc.rust-lang.org/std/iter/trait.IntoIterator.html"><code>IntoIterator</code></a> of <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s</p>
</div><h4id='method.display_order'class="method"><codeid='display_order.v'>pub fn <ahref='#method.display_order'class='fnname'>display_order</a>(self, ord: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#1137-1140'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows custom ordering of <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s within the help message. Subcommands with a lower
value will be displayed first in the help message. This is helpful when one would like to
emphasise frequently used subcommands, or prioritize those towards the top of the list.
Duplicate values <strong>are</strong> allowed. Subcommands with duplicate display orders will be
displayed in alphabetical order.</p>
<p><strong>NOTE:</strong> The default is 999 for all subcommands.</p>
.<spanclass="ident">subcommand</span>(<spanclass="ident">SubCommand</span>::<spanclass="ident">with_name</span>(<spanclass="string">"alpha"</span>) <spanclass="comment">// typically subcommands are grouped</span>
<spanclass="comment">// alphabetically by name. Subcommands</span>
<spanclass="comment">// without a display_order have a value of</span>
<spanclass="comment">// 999 and are displayed alphabetically with</span>
<spanclass="comment">// all other 999 subcommands</span>
.<spanclass="ident">about</span>(<spanclass="string">"Some help and text"</span>))
.<spanclass="ident">display_order</span>(<spanclass="number">1</span>) <spanclass="comment">// In order to force this subcommand to appear *first*</span>
<spanclass="comment">// all we have to do is give it a value lower than 999.</span>
<spanclass="comment">// Any other subcommands with a value of 1 will be displayed</span>
<spanclass="comment">// alphabetically with this one...then 2 values, then 3, etc.</span>
.<spanclass="ident">about</span>(<spanclass="string">"I should be first!"</span>))
<p>The above example displays the following help message</p>
<pre><codeclass="language-text">cust-ord
USAGE:
cust-ord [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
beta I should be first!
alpha Some help and text
</code></pre>
</div><h4id='method.print_help'class="method"><codeid='print_help.v'>pub fn <ahref='#method.print_help'class='fnname'>print_help</a>(&mut self) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1159-1170'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Prints the full help message to <ahref="https://doc.rust-lang.org/std/io/fn.stdout.html"><code>io::stdout()</code></a> using a <ahref="https://doc.rust-lang.org/std/io/struct.BufWriter.html"><code>BufWriter</code></a> using the same
method as if someone ran <code>-h</code> to request the help message</p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" help messages
depending on if the user ran <ahref="./struct.Arg.html#method.help"><code>-h</code> (short)</a> or <ahref="./struct.Arg.html#method.long_help"><code>--help</code> (long)</a></p>
</div><h4id='method.print_long_help'class="method"><codeid='print_long_help.v'>pub fn <ahref='#method.print_long_help'class='fnname'>print_long_help</a>(&mut self) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1189-1193'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Prints the full help message to <ahref="https://doc.rust-lang.org/std/io/fn.stdout.html"><code>io::stdout()</code></a> using a <ahref="https://doc.rust-lang.org/std/io/struct.BufWriter.html"><code>BufWriter</code></a> using the same
method as if someone ran <code>--help</code> to request the help message</p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" help messages
depending on if the user ran <ahref="./struct.Arg.html#method.help"><code>-h</code> (short)</a> or <ahref="./struct.Arg.html#method.long_help"><code>--help</code> (long)</a></p>
</div><h4id='method.write_help'class="method"><codeid='write_help.v'>pub fn <ahref='#method.write_help'class='fnname'>write_help</a><W: <aclass="trait"href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html"title="trait std::io::Write">Write</a>>(&self, w: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1217-1228'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Writes the full help message to the user to a <ahref="https://doc.rust-lang.org/std/io/trait.Write.html"><code>io::Write</code></a> object in the same method as if
the user ran <code>-h</code></p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" help messages
depending on if the user ran <ahref="./struct.Arg.html#method.help"><code>-h</code> (short)</a> or <ahref="./struct.Arg.html#method.long_help"><code>--help</code> (long)</a></p>
<p><strong>NOTE:</strong> There is a known bug where this method does not write propagated global arguments
or autogenerated arguments (i.e. the default help/version args). Prefer
<ahref="../clap/struct.App.html#method.write_long_help"title="`App::write_long_help`"><code>App::write_long_help</code></a> instead if possible!</p>
<spanclass="ident">app</span>.<spanclass="ident">write_help</span>(<spanclass="kw-2">&</span><spanclass="kw-2">mut</span><spanclass="ident">out</span>).<spanclass="ident">expect</span>(<spanclass="string">"failed to write to stdout"</span>);</pre></div>
</div><h4id='method.write_long_help'class="method"><codeid='write_long_help.v'>pub fn <ahref='#method.write_long_help'class='fnname'>write_long_help</a><W: <aclass="trait"href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html"title="trait std::io::Write">Write</a>>(&mut self, w: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1248-1257'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Writes the full help message to the user to a <ahref="https://doc.rust-lang.org/std/io/trait.Write.html"><code>io::Write</code></a> object in the same method as if
the user ran <code>--help</code></p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" help messages
depending on if the user ran <ahref="./struct.Arg.html#method.help"><code>-h</code> (short)</a> or <ahref="./struct.Arg.html#method.long_help"><code>--help</code> (long)</a></p>
<spanclass="ident">app</span>.<spanclass="ident">write_long_help</span>(<spanclass="kw-2">&</span><spanclass="kw-2">mut</span><spanclass="ident">out</span>).<spanclass="ident">expect</span>(<spanclass="string">"failed to write to stdout"</span>);</pre></div>
</div><h4id='method.write_version'class="method"><codeid='write_version.v'>pub fn <ahref='#method.write_version'class='fnname'>write_version</a><W: <aclass="trait"href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html"title="trait std::io::Write">Write</a>>(&self, w: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1276-1278'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Writes the version message to the user to a <ahref="https://doc.rust-lang.org/std/io/trait.Write.html"><code>io::Write</code></a> object as if the user ran <code>-V</code>.</p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" version messages
depending on if the user ran <ahref="./struct.App.html#method.version"><code>-V</code> (short)</a> or <ahref="./struct.App.html#method.long_version"><code>--version</code> (long)</a></p>
<spanclass="ident">app</span>.<spanclass="ident">write_version</span>(<spanclass="kw-2">&</span><spanclass="kw-2">mut</span><spanclass="ident">out</span>).<spanclass="ident">expect</span>(<spanclass="string">"failed to write to stdout"</span>);</pre></div>
</div><h4id='method.write_long_version'class="method"><codeid='write_long_version.v'>pub fn <ahref='#method.write_long_version'class='fnname'>write_long_version</a><W: <aclass="trait"href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html"title="trait std::io::Write">Write</a>>(&self, w: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1297-1299'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Writes the version message to the user to a <ahref="https://doc.rust-lang.org/std/io/trait.Write.html"><code>io::Write</code></a> object</p>
<p><strong>NOTE:</strong> clap has the ability to distinguish between "short" and "long" version messages
depending on if the user ran <ahref="./struct.App.html#method.version"><code>-V</code> (short)</a> or <ahref="./struct.App.html#method.long_version"><code>--version</code> (long)</a></p>
<spanclass="ident">app</span>.<spanclass="ident">write_long_version</span>(<spanclass="kw-2">&</span><spanclass="kw-2">mut</span><spanclass="ident">out</span>).<spanclass="ident">expect</span>(<spanclass="string">"failed to write to stdout"</span>);</pre></div>
</div><h4id='method.gen_completions'class="method"><codeid='gen_completions.v'>pub fn <ahref='#method.gen_completions'class='fnname'>gen_completions</a><T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsString.html"title="struct std::ffi::os_str::OsString">OsString</a>>, S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(<br> &mut self, <br> bin_name: S, <br> for_shell: <aclass="enum"href="../clap/enum.Shell.html"title="enum clap::Shell">Shell</a>, <br> out_dir: T<br>)</code><aclass='srclink'href='../src/clap/app/mod.rs.html#1384-1392'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Generate a completions file for a specified shell at compile time.</p>
<p><strong>NOTE:</strong> to generate the file at compile time you must use a <code>build.rs</code>"Build Script"</p>
.<spanclass="ident">help</span>(<spanclass="string">"the case to test"</span>)))
}</pre></div>
<p>In our regular code, we can simply call this <code>build_cli()</code> function, then call
<code>get_matches()</code>, or any of the other normal methods directly after. For example:</p>
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
<spanclass="comment">// normal logic continues...</span>
}</pre></div>
<p>Next, we set up our <code>Cargo.toml</code> to use a <code>build.rs</code> build script.</p>
<pre><codeclass="language-toml"># Cargo.toml
build = "build.rs"
[build-dependencies]
clap = "2.23"
</code></pre>
<p>Next, we place a <code>build.rs</code> in our project root.</p>
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
<spanclass="ident">app</span>.<spanclass="ident">gen_completions</span>(<spanclass="string">"myapp"</span>, <spanclass="comment">// We need to specify the bin name manually</span>
<spanclass="ident">Shell</span>::<spanclass="ident">Bash</span>, <spanclass="comment">// Then say which shell to build completions for</span>
<spanclass="ident">outdir</span>); <spanclass="comment">// Then say where write the completions to</span>
}</pre></div>
<p>Now, once we compile there will be a <code>{bin_name}.bash</code> file in the directory.
Assuming we compiled with debug mode, it would be somewhere similar to
<p>Assuming a separate <code>cli.rs</code> like the <ahref="./struct.App.html#method.gen_completions">example above</a>,
we can let users generate a completion script using a command:</p>
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
</div><h4id='method.get_matches'class="method"><codeid='get_matches.v'>pub fn <ahref='#method.get_matches'class='fnname'>get_matches</a>(self) -><aclass="struct"href="../clap/struct.ArgMatches.html"title="struct clap::ArgMatches">ArgMatches</a><'a></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1451'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Starts the parsing process, upon a failed parse an error will be displayed to the user and
the process will exit with the appropriate error code. By default this method gets all user
provided arguments from <ahref="https://doc.rust-lang.org/std/env/fn.args_os.html"><code>env::args_os</code></a> in order to allow for invalid UTF-8 code points,
</div><h4id='method.get_matches_safe'class="method"><codeid='get_matches_safe.v'>pub fn <ahref='#method.get_matches_safe'class='fnname'>get_matches_safe</a>(self) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="struct"href="../clap/struct.ArgMatches.html"title="struct clap::ArgMatches">ArgMatches</a><'a>></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1478-1481'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Starts the parsing process. This method will return a <ahref="./type.Result.html"><code>clap::Result</code></a> type instead of exiting
the process on failed parse. By default this method gets matches from <ahref="https://doc.rust-lang.org/std/env/fn.args_os.html"><code>env::args_os</code></a></p>
<p><strong>NOTE:</strong> This method WILL NOT exit when <code>--help</code> or <code>--version</code> (or short versions) are
used. It will return a <ahref="./struct.Error.html"><code>clap::Error</code></a>, where the <ahref="./struct.Error.html"><code>kind</code></a> is a
<ahref="./enum.ErrorKind.html#variant.HelpDisplayed"><code>ErrorKind::HelpDisplayed</code></a> or <ahref="./enum.ErrorKind.html#variant.VersionDisplayed"><code>ErrorKind::VersionDisplayed</code></a> respectively. You must call
<ahref="./struct.Error.html#method.exit"><code>Error::exit</code></a> or perform a <ahref="https://doc.rust-lang.org/std/process/fn.exit.html"><code>std::process::exit</code></a>.</p>
</div><h4id='method.get_matches_from'class="method"><codeid='get_matches_from.v'>pub fn <ahref='#method.get_matches_from'class='fnname'>get_matches_from</a><I, T>(self, itr: I) -><aclass="struct"href="../clap/struct.ArgMatches.html"title="struct clap::ArgMatches">ArgMatches</a><'a><spanclass="where fmt-newline">where<br> I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsString.html"title="struct std::ffi::os_str::OsString">OsString</a>> + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1504-1527'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Starts the parsing process. Like <ahref="./struct.App.html#method.get_matches"><code>App::get_matches</code></a> this method does not return a <ahref="./type.Result.html"><code>clap::Result</code></a>
and will automatically exit with an error message. This method, however, lets you specify
what iterator to use when performing matches, such as a <ahref="https://doc.rust-lang.org/std/vec/struct.Vec.html"><code>Vec</code></a> of your making.</p>
<p><strong>NOTE:</strong> The first argument will be parsed as the binary name unless
<ahref="./enum.AppSettings.html#variant.NoBinaryName"><code>AppSettings::NoBinaryName</code></a> is used</p>
<p><strong>NOTE:</strong> This method WILL NOT exit when <code>--help</code> or <code>--version</code> (or short versions) are
used. It will return a <ahref="./struct.Error.html"><code>clap::Error</code></a>, where the <ahref="./struct.Error.html"><code>kind</code></a> is a <ahref="./enum.ErrorKind.html#variant.HelpDisplayed"><code>ErrorKind::HelpDisplayed</code></a>
or <ahref="./enum.ErrorKind.html#variant.VersionDisplayed"><code>ErrorKind::VersionDisplayed</code></a> respectively. You must call <ahref="./struct.Error.html#method.exit"><code>Error::exit</code></a> or
perform a <ahref="https://doc.rust-lang.org/std/process/fn.exit.html"><code>std::process::exit</code></a> yourself.</p>
<p><strong>NOTE:</strong> The first argument will be parsed as the binary name unless
<ahref="./enum.AppSettings.html#variant.NoBinaryName"><code>AppSettings::NoBinaryName</code></a> is used</p>
</div><h4id='method.get_matches_from_safe_borrow'class="method"><codeid='get_matches_from_safe_borrow.v'>pub fn <ahref='#method.get_matches_from_safe_borrow'class='fnname'>get_matches_from_safe_borrow</a><I, T>(<br> &mut self, <br> itr: I<br>) -><aclass="type"href="../clap/type.Result.html"title="type clap::Result">ClapResult</a><<aclass="struct"href="../clap/struct.ArgMatches.html"title="struct clap::ArgMatches">ArgMatches</a><'a>><spanclass="where fmt-newline">where<br> I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsString.html"title="struct std::ffi::os_str::OsString">OsString</a>> + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1590-1637'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Starts the parsing process without consuming the <ahref="./struct.App.html"><code>App</code></a> struct <code>self</code>. This is normally not
the desired functionality, instead prefer <ahref="./struct.App.html#method.get_matches_from_safe"><code>App::get_matches_from_safe</code></a> which <em>does</em>
consume <code>self</code>.</p>
<p><strong>NOTE:</strong> The first argument will be parsed as the binary name unless
<ahref="./enum.AppSettings.html#variant.NoBinaryName"><code>AppSettings::NoBinaryName</code></a> is used</p>
</div></div><h2id='implementations'class='small-section-header'>Trait Implementations<ahref='#implementations'class='anchor'></a></h2><divid='implementations-list'><h3id='impl-Clone'class='impl'><codeclass='in-band'>impl<'a, 'b><aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="../clap/struct.App.html"title="struct clap::App">App</a><'a, 'b></code><ahref='#impl-Clone'class='anchor'></a><aclass='srclink'href='../src/clap/app/mod.rs.html#1783-1785'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.clone'class="method hidden"><codeid='clone.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone'class='fnname'>clone</a>(&self) -> Self</code><aclass='srclink'href='../src/clap/app/mod.rs.html#1784'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Returns a copy of the value. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4id='method.clone_from'class="method hidden"><codeid='clone_from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from'class='fnname'>clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><spanclass='since'title='Stable since Rust version 1.0.0'>1.0.0</span><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3id='impl-Display'class='impl'><codeclass='in-band'>impl<'n, 'e><aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> for <aclass="struct"href="../clap/struct.App.html"title="struct clap::App">App</a><'n, 'e></code><ahref='#impl-Display'class='anchor'></a><aclass='srclink'href='../src/clap/app/mod.rs.html#1837-1839'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.fmt'class="method hidden"><codeid='fmt.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt'class='fnname'>fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a>) -><aclass="type"href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></code><aclass='srclink'href='../src/clap/app/mod.rs.html#1838'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3id='impl-ToString'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html"title="trait alloc::string::ToString">ToString</a> for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-ToString'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2134-2144'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.to_string'class="method hidden"><codeid='to_string.v'>default fn <ahref='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string'class='fnname'>to_string</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2136-2143'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Converts the given value to a <code>String</code>. <ahref="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3id='impl-ToOwned'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><ahref='#impl-ToOwned'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Owned'class="type"><codeid='Owned.t'>type <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned'class="type">Owned</a> = T</code></h4><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4id='method.to_owned'class="method hidden"><codeid='to_owned.v'>fn <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned'class='fnname'>to_owned</a>(&self) -> T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4id='method.clone_into'class="method hidden"><codeid='clone_into.v'>fn <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into'class='fnname'>clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91'title='goto source code'>[src]</a></h4><divclass='stability hidden'><divclass='stab unstable'><details><summary><spanclass='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><divclass='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3id='impl-TryFrom%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref='#impl-TryFrom%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error'class="type"><codeid='Error.t'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error'class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_from'class="method hidden"><codeid='try_from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from'class='fnname'>try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-TryInto%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref='#impl-TryInto%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error-1'class="type"><codeid='Error.t-1'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error'class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_into'class="method hidden"><codeid='try_into.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into'class='fnname'>try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-BorrowMut%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-BorrowMut%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow_mut'class="method hidden"><codeid='borrow_mut.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut'class='fnname'>borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3id='impl-Borrow%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Borrow%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow'class="method hidden"><codeid='borrow.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow'class='fnname'>borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3id='impl-Any'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br> T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Any'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.type_id'class="method hidden"><codeid='type_id.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id'class='fnname'>type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div></div></section><sectionid="search"class="content hidden"></section><sectionclass="footer"></section><asideid="help"class="hidden"><div><h1class="hidden">Help</h1><divclass="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><divclass="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath="../";window.currentCrate="clap";</script><scriptsrc="../aliases.js"></script><scriptsrc="../main.js"></script><scriptdefersrc="../search-index.js"></script></body></html>