<!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 `Arg` struct in crate `structopt`."><metaname="keywords"content="rust, rustlang, rust-lang, Arg"><title>structopt::clap::Arg - 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='../../structopt/index.html'><divclass='logo-container'><imgsrc='../../rust-logo.png'alt='logo'></div></a><pclass='location'>Struct Arg</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#methods">Methods</a><divclass="sidebar-links"><ahref="#method.alias">alias</a><ahref="#method.aliases">aliases</a><ahref="#method.allow_hyphen_values">allow_hyphen_values</a><ahref="#method.case_insensitive">case_insensitive</a><ahref="#method.conflicts_with">conflicts_with</a><ahref="#method.conflicts_with_all">conflicts_with_all</a><ahref="#method.default_value">default_value</a><ahref="#method.default_value_if">default_value_if</a><ahref="#method.default_value_if_os">default_value_if_os</a><ahref="#method.default_value_ifs">default_value_ifs</a><ahref="#method.default_value_ifs_os">default_value_ifs_os</a><ahref="#method.default_value_os">default_value_os</a><ahref="#method.display_order">display_order</a><ahref="#method.empty_values">empty_values</a><ahref="#method.env">env</a><ahref="#method.env_os">env_os</a><ahref="#method.from_usage">from_usage</a><ahref="#method.global">global</a><ahref="#method.group">group</a><ahref="#method.groups">groups</a><ahref="#method.help">help</a><ahref="#method.hidden">hidden</a><ahref="#method.hidden_long_help">hidden_long_help</a><ahref="#method.hidden_short_help">hidden_short_help</a><ahref="#method.hide_default_value">hide_default_value</a><ahref="#method.hide_env_values">hide_env_values</a><ahref="#method.hide_possible_values">hide_possible_values</a><ahref="#method.index">index</a><ahref="#method.is_set">is_set</a><ahref="#method.last">last</a><ahref="#method.long">long</a><ahref="#method.long_help">long_help</a><ahref="#method.max_values">max_values</a><ahref="#method.min_values">min_values</a><ahref="#method.multiple">multiple</a><ahref="#method.next_line_help">next_line_help</a><ahref="#method.number_of_values">number_of_values</a><ahref="#method.overrides_with">overrides_with</a><ahref="#method.overrides_with_all">overrides_with_all</a><ahref="#method.possible_value">possible_value</a><ahref="#method.possible_values">possible_values</a><ahref="#method.raw">raw</a><ahref="#method.require_delimiter">require_delimiter</a><ahref="#method.require_equals">require_equals</a><ahref="#method.required">required</a><ahref="#method.required_if">required_if</a><ahref="#method.required_ifs">required_ifs</a><ahref="#method.required_unless">required_unless</a><ahref="#method.required_unless_all">required_unless_all</a><ahref="#method.required_unless_one">required_unless_one</a><ahref="#method.requires">requires</a><ahref="#method.requires_all">requires_all</a><ahref="#method.requires_if">requires_if</a><ahref="#method.requires_ifs">requires_ifs</a><ahref="#method.set">set</a><ahref="#method.short">short</a><ahref="#method.takes_value">takes_value</a><ahref="#method.unset">unset<
relationships that define a valid argument for the program.</p>
<p>There are two methods for constructing <ahref="./struct.Arg.html"><code>Arg</code></a>s, using the builder pattern and setting options
manually, or using a usage string which is far less verbose but has fewer options. You can also
use a combination of the two methods to achieve the best of both worlds.</p>
.<spanclass="ident">help</span>(<spanclass="string">"Provides a config file to myprog"</span>);
<spanclass="comment">// Using a usage string (setting a similar argument to the one above)</span>
<spanclass="kw">let</span><spanclass="ident">input</span><spanclass="op">=</span><spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"-i, --input=[FILE] 'Provides an input file to the program'"</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="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><ahref='#impl'class='anchor'></a><aclass='srclink'href='../../src/clap/args/arg.rs.html#54-3936'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.with_name'class="method"><codeid='with_name.v'>pub fn <ahref='#method.with_name'class='fnname'>with_name</a>(n: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#72-77'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Creates a new instance of <ahref="./struct.Arg.html"><code>Arg</code></a> using a unique string name. The name will be used to get
information about whether or not the argument was used at runtime, get values, set
relationships with other args, etc..</p>
<p><strong>NOTE:</strong> In the case of arguments that take values (i.e. <ahref="./struct.Arg.html#method.takes_value"><code>Arg::takes_value(true)</code></a>)
and positional arguments (i.e. those without a preceding <code>-</code> or <code>--</code>) the name will also
be displayed when the user prints the usage/help information of the program.</p>
</div><h4id='method.from_usage'class="method"><codeid='from_usage.v'>pub fn <ahref='#method.from_usage'class='fnname'>from_usage</a>(u: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#290-293'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Creates a new instance of <ahref="./struct.Arg.html"><code>Arg</code></a> from a usage string. Allows creation of basic settings
for the <ahref="./struct.Arg.html"><code>Arg</code></a>. The syntax is flexible, but there are some rules to follow.</p>
<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>
<p><strong>NOTE</strong>: Only ASCII values are officially supported in <ahref="./struct.Arg.html#method.from_usage"><code>Arg::from_usage</code></a> strings. Some
UTF-8 codepoints may work just fine, but this is not guaranteed.</p>
<spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"--config <FILE>'a required file for the configuration and no short'"</span>),
<spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"-d, --debug... 'turns on debugging information and allows multiples'"</span>),
<spanclass="ident">Arg</span>::<spanclass="ident">from_usage</span>(<spanclass="string">"[input] 'an optional input file to use'"</span>)
])</pre></div>
</div><h4id='method.short'class="method"><codeid='short.v'>pub fn <ahref='#method.short'class='fnname'>short</a><S>(self, s: S) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b><spanclass="where fmt-newline">where<br> 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>>, </span></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#331-334'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the short version of the argument without the preceding <code>-</code>.</p>
<p>By default <code>clap</code> automatically assigns <code>V</code> and <code>h</code> to the auto-generated <code>version</code> and
<code>help</code> arguments respectively. You may use the uppercase <code>V</code> or lowercase <code>h</code> for your own
arguments, in which case <code>clap</code> simply will not assign those to the auto-generated
<code>version</code> or <code>help</code> arguments.</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 <ahref="./struct.Arg.html#method.short"><code>short</code></a> version</p>
<p>To set <ahref="./struct.Arg.html#method.short"><code>short</code></a> use a single valid UTF-8 code point. If you supply a leading <code>-</code> such as
<code>-c</code>, the <code>-</code> will be stripped.</p>
<p>Setting <ahref="./struct.Arg.html#method.short"><code>short</code></a> allows using the argument via a single hyphen (<code>-</code>) such as <code>-c</code></p>
</div><h4id='method.long'class="method"><codeid='long.v'>pub fn <ahref='#method.long'class='fnname'>long</a>(self, l: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#371-374'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the long version of the argument without the preceding <code>--</code>.</p>
<p>By default <code>clap</code> automatically assigns <code>version</code> and <code>help</code> to the auto-generated
<code>version</code> and <code>help</code> arguments respectively. You may use the word <code>version</code> or <code>help</code> for
the long form of your own arguments, in which case <code>clap</code> simply will not assign those to
the auto-generated <code>version</code> or <code>help</code> arguments.</p>
<p><strong>NOTE:</strong> Any leading <code>-</code> characters will be stripped</p>
</div><h4id='method.alias'class="method"><codeid='alias.v'>pub fn <ahref='#method.alias'class='fnname'>alias</a><S>(self, name: S) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b><spanclass="where fmt-newline">where<br> 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>>, </span></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#397-404'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding a <ahref="./struct.Arg.html"><code>Arg</code></a> alias, which function as "hidden" arguments that
automatically dispatch as if this argument was used. This is more efficient, and easier
than creating multiple hidden arguments 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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#427-436'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding <ahref="./struct.Arg.html"><code>Arg</code></a> aliases, which function as "hidden" arguments that
automatically dispatch as if this argument 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>(self, name: S) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b><spanclass="where fmt-newline">where<br> 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>>, </span></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#458-465'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding a <ahref="./struct.Arg.html"><code>Arg</code></a> alias that functions exactly like those defined with
<ahref="../../structopt/clap/struct.Arg.html#method.alias"title="`Arg::alias`"><code>Arg::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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#485-494'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows adding multiple <ahref="./struct.Arg.html"><code>Arg</code></a> aliases that functions exactly like those defined
with <ahref="../../structopt/clap/struct.Arg.html#method.aliases"title="`Arg::aliases`"><code>Arg::aliases</code></a>, except that they are visible inside the help message.</p>
</div><h4id='method.help'class="method"><codeid='help.v'>pub fn <ahref='#method.help'class='fnname'>help</a>(self, h: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#546-549'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the short help text of the argument that will be displayed to the user when they print
the help information with <code>-h</code>. Typically, this is a short (one line) description of the
arg.</p>
<p><strong>NOTE:</strong> If only <code>Arg::help</code> is provided, and not <ahref="./struct.Arg.html#method.long_help"><code>Arg::long_help</code></a> but the user requests
<code>--help</code> clap will still display the contents of <code>help</code> appropriately</p>
<p><strong>NOTE:</strong> Only <code>Arg::help</code> is used in completion script generation in order to be concise</p>
--config Some help text describing the --config arg
-h, --help Prints help information
-V, --version Prints version information
</code></pre>
</div><h4id='method.long_help'class="method"><codeid='long_help.v'>pub fn <ahref='#method.long_help'class='fnname'>long_help</a>(self, h: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#617-620'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets the long help text of the argument that will be displayed to the user when they print
the help information with <code>--help</code>. Typically this a more detailed (multi-line) message
that describes the arg.</p>
<p><strong>NOTE:</strong> If only <code>long_help</code> is provided, and not <ahref="./struct.Arg.html#method.help"><code>Arg::help</code></a> but the user requests <code>-h</code>
clap will still display the contents of <code>long_help</code> appropriately</p>
<p><strong>NOTE:</strong> Only <ahref="./struct.Arg.html#method.help"><code>Arg::help</code></a> is used in completion script generation in order to be concise</p>
The config file used by the myprog must be in JSON format
with only valid keys and may not contain other nonsense
that cannot be read by this program. Obviously I'm going on
and on, so I'll stop now.
-h, --help
Prints help information
-V, --version
Prints version information
</code></pre>
</div><h4id='method.last'class="method"><codeid='last.v'>pub fn <ahref='#method.last'class='fnname'>last</a>(self, l: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#694-700'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that this arg is the last, or final, positional argument (i.e. has the highest
index) and is <em>only</em> able to be accessed via the <code>--</code> syntax (i.e. <code>$ prog args -- last_arg</code>). Even, if no other arguments are left to parse, if the user omits the <code>--</code> syntax
they will receive an <ahref="./enum.ErrorKind.html#variant.UnknownArgument"><code>UnknownArgument</code></a> error. Setting an argument to <code>.last(true)</code> also
allows one to access this arg early using the <code>--</code> syntax. Accessing an arg early, even with
the <code>--</code> syntax is otherwise not possible.</p>
<p><strong>NOTE:</strong> This will change the usage string to look like <code>$ prog [FLAGS] [-- <ARG>]</code> if
<code>ARG</code> is marked as <code>.last(true)</code>.</p>
<p><strong>NOTE:</strong> This setting will imply <ahref="./enum.AppSettings.html#variant.DontCollapseArgsInUsage"><code>AppSettings::DontCollapseArgsInUsage</code></a> because failing
to set this can make the usage string very confusing.</p>
<p><strong>NOTE</strong>: This setting only applies to positional arguments, and has no affect on FLAGS /
OPTIONS</p>
<p><strong>CAUTION:</strong> Setting an argument to <code>.last(true)</code><em>and</em> having child subcommands is not
recommended with the exception of <em>also</em> using <ahref="./enum.AppSettings.html#variant.ArgsNegateSubcommands"><code>AppSettings::ArgsNegateSubcommands</code></a>
(or <ahref="./enum.AppSettings.html#variant.SubcommandsNegateReqs"><code>AppSettings::SubcommandsNegateReqs</code></a> if the argument marked <code>.last(true)</code> is also
<p>Setting <ahref="./struct.Arg.html#method.last"><code>Arg::last(true)</code></a> ensures the arg has the highest <ahref="./struct.Arg.html#method.index">index</a> of all positional args
and requires that the <code>--</code> syntax be used to access it early.</p>
</div><h4id='method.required'class="method"><codeid='required.v'>pub fn <ahref='#method.required'class='fnname'>required</a>(self, r: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#753-759'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets whether or not the argument is required by default. Required by default means it is
required, when no other conflicting rules have been evaluated. Conflicting rules take
precedence over being required. <strong>Default:</strong><code>false</code></p>
<p><strong>NOTE:</strong> Flags (i.e. not positional, or arguments that take values) cannot be required by
default. This is simply because if a flag should be required, it should simply be implied
as no additional information is required from user. Flags by their very nature are simply
</div><h4id='method.require_equals'class="method"><codeid='require_equals.v'>pub fn <ahref='#method.require_equals'class='fnname'>require_equals</a>(self, r: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#815-822'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Requires that options use the <code>--option=val</code> syntax (i.e. an equals between the option and
<p>Setting <ahref="./struct.Arg.html#method.require_equals"><code>Arg::require_equals(true)</code></a> requires that the option have an equals sign between
<p>Setting <ahref="./struct.Arg.html#method.require_equals"><code>Arg::require_equals(true)</code></a> and <em>not</em> supplying the equals will cause an error
unless <ahref="./struct.Arg.html#method.empty_values"><code>Arg::empty_values(true)</code></a> is set.</p>
</div><h4id='method.allow_hyphen_values'class="method"><codeid='allow_hyphen_values.v'>pub fn <ahref='#method.allow_hyphen_values'class='fnname'>allow_hyphen_values</a>(self, a: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#880-886'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows values which start with a leading hyphen (<code>-</code>)</p>
<p><strong>WARNING</strong>: Take caution when using this setting combined with <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a>, as
this becomes ambiguous <code>$ prog --arg -- -- val</code>. All three <code>--, --, val</code> will be values
when the user may have thought the second <code>--</code> would constitute the normal, "Only
positional args follow" idiom. To fix this, consider using <ahref="./struct.Arg.html#method.number_of_values"><code>Arg::number_of_values(1)</code></a></p>
<p><strong>WARNING</strong>: When building your CLIs, consider the effects of allowing leading hyphens and
the user passing in a value that matches a valid short. For example <code>prog -opt -F</code> where
<code>-F</code> is supposed to be a value, yet <code>-F</code> is <em>also</em> a valid short for another arg. Care should
should be taken when designing these args. This is compounded by the ability to "stack"
short args. I.e. if <code>-val</code> is supposed to be a value, but <code>-v</code>, <code>-a</code>, and <code>-l</code> are all valid
<p>Not setting <ahref="./struct.Arg.html#method.allow_hyphen_values"><code>Arg::allow_hyphen_values(true)</code></a> and supplying a value which starts with a
</div><h4id='method.required_unless'class="method"><codeid='required_unless.v'>pub fn <ahref='#method.required_unless'class='fnname'>required_unless</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#943-950'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets an arg that override this arg's required setting. (i.e. this arg will be required
unless this other argument is present).</p>
<p><strong>Pro Tip:</strong> Using <ahref="./struct.Arg.html#method.required_unless"><code>Arg::required_unless</code></a> implies <ahref="./struct.Arg.html#method.required"><code>Arg::required</code></a> and is therefore not
<p>Setting <ahref="./struct.Arg.html#method.required_unless"><code>Arg::required_unless(name)</code></a> and <em>not</em> supplying <code>name</code> or this arg is an error.</p>
</div><h4id='method.required_unless_all'class="method"><codeid='required_unless_all.v'>pub fn <ahref='#method.required_unless_all'class='fnname'>required_unless_all</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'a <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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1015-1025'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets args that override this arg's required setting. (i.e. this arg will be required unless
all these other arguments are present).</p>
<p><strong>NOTE:</strong> If you wish for this argument to only be required if <em>one of</em> these args are
present see <ahref="./struct.Arg.html#method.required_unless_one"><code>Arg::required_unless_one</code></a></p>
<p>Setting <ahref="./struct.Arg.html#method.required_unless_all"><code>Arg::required_unless_all(names)</code></a> requires that the argument be used at runtime
<em>unless</em><em>all</em> the args in <code>names</code> are present. In the following example, the required
argument is <em>not</em> provided, but it's not an error because all the <code>unless</code> args have been
<p>Setting <ahref="./struct.Arg.html#method.required_unless_all"><code>Arg::required_unless_all(names)</code></a> and <em>not</em> supplying <em>all</em> of <code>names</code> or this
</div><h4id='method.required_unless_one'class="method"><codeid='required_unless_one.v'>pub fn <ahref='#method.required_unless_one'class='fnname'>required_unless_one</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'a <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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1091-1100'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets args that override this arg's <ahref="./struct.Arg.html#method.required">required</a> setting. (i.e. this arg will be required
unless <em>at least one of</em> these other arguments are present).</p>
<p><strong>NOTE:</strong> If you wish for this argument to only be required if <em>all of</em> these args are
present see <ahref="./struct.Arg.html#method.required_unless_all"><code>Arg::required_unless_all</code></a></p>
<p>Setting <ahref="./struct.Arg.html#method.required_unless_one"><code>Arg::required_unless_one(names)</code></a> requires that the argument be used at runtime
<em>unless</em><em>at least one of</em> the args in <code>names</code> are present. In the following example, the
required argument is <em>not</em> provided, but it's not an error because one the <code>unless</code> args
<p>Setting <ahref="./struct.Arg.html#method.required_unless_one"><code>Arg::required_unless_one(names)</code></a> and <em>not</em> supplying <em>at least one of</em><code>names</code>
</div><h4id='method.conflicts_with'class="method"><codeid='conflicts_with.v'>pub fn <ahref='#method.conflicts_with'class='fnname'>conflicts_with</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1139-1146'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a conflicting argument by name. I.e. when using this argument,
the following argument can't be present and vice versa.</p>
<p><strong>NOTE:</strong> Conflicting rules take precedence over being required by default. Conflict rules
only need to be set for one of the two arguments, they do not need to be set for each.</p>
<p><strong>NOTE:</strong> Defining a conflict is two-way, but does <em>not</em> need to defined for both arguments
(i.e. if A conflicts with B, defining A.conflicts_with(B) is sufficient. You do not need
</div><h4id='method.overrides_with'class="method"><codeid='overrides_with.v'>pub fn <ahref='#method.overrides_with'class='fnname'>overrides_with</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1298-1305'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets a overridable argument by name. I.e. this argument and the following argument
will override each other in POSIX style (whichever argument was specified at runtime
<strong>last</strong>"wins")</p>
<p><strong>NOTE:</strong> When an argument is overridden it is essentially as if it never was used, any
conflicts, requirements, etc. are evaluated <strong>after</strong> all "overrides" have been removed</p>
<p><strong>WARNING:</strong> Positional arguments cannot override themselves (or we would never be able
to advance to the next positional). If a positional agument lists itself as an override,
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">m</span>.<spanclass="ident">is_present</span>(<spanclass="string">"debug"</span>)); <spanclass="comment">// even though flag conflicts with debug, it's as if flag</span>
<spanclass="comment">// was never used because it was overridden with color</span>
</div><h4id='method.overrides_with_all'class="method"><codeid='overrides_with_all.v'>pub fn <ahref='#method.overrides_with_all'class='fnname'>overrides_with_all</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'a <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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1334-1343'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets multiple mutually overridable arguments by name. I.e. this argument and the following
argument will override each other in POSIX style (whichever argument was specified at
<spanclass="comment">// ^~~~~~^~~~~~~~~ flag and debug are overridden by color</span>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">m</span>.<spanclass="ident">is_present</span>(<spanclass="string">"color"</span>)); <spanclass="comment">// even though flag conflicts with color, it's as if flag</span>
<spanclass="comment">// and debug were never used because they were overridden</span>
</div><h4id='method.requires'class="method"><codeid='requires.v'>pub fn <ahref='#method.requires'class='fnname'>requires</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1400-1409'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets an argument by name that is required when this one is present I.e. when
using this argument, the following argument <em>must</em> be present.</p>
<p><strong>NOTE:</strong><ahref="./struct.Arg.html#method.conflicts_with">Conflicting</a> rules and <ahref="./struct.Arg.html#method.overrides_with">override</a> rules take precedence over being required</p>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_ok</span>()); <spanclass="comment">// We didn't use cfg, so input wasn't required</span></pre></div>
<p>Setting <ahref="./struct.Arg.html#method.requires"><code>Arg::requires(name)</code></a> and <em>not</em> supplying that argument is an error.</p>
</div><h4id='method.requires_if'class="method"><codeid='requires_if.v'>pub fn <ahref='#method.requires_if'class='fnname'>requires_if</a>(self, val: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, arg: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1470-1477'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows a conditional requirement. The requirement will only become valid if this arg's value
equals <code>val</code>.</p>
<p><strong>NOTE:</strong> If using YAML the values should be laid out as follows</p>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_ok</span>()); <spanclass="comment">// We didn't use --config=my.cfg, so other wasn't required</span></pre></div>
<p>Setting [<code>Arg::requires_if(val, arg)</code>] and setting the value to <code>val</code> but <em>not</em> supplying
</div><h4id='method.requires_ifs'class="method"><codeid='requires_ifs.v'>pub fn <ahref='#method.requires_ifs'class='fnname'>requires_ifs</a>(self, ifs: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &'a <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.tuple.html">)</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1530-1543'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows multiple conditional requirements. The requirement will only become valid if this arg's value
equals <code>val</code>.</p>
<p><strong>NOTE:</strong> If using YAML the values should be laid out as follows</p>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_err</span>()); <spanclass="comment">// We used --config=special.conf so --option <val> is required</span>
</div><h4id='method.required_if'class="method"><codeid='required_if.v'>pub fn <ahref='#method.required_if'class='fnname'>required_if</a>(self, arg: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, val: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1608-1615'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows specifying that an argument is <ahref="./struct.Arg.html#method.required">required</a> conditionally. The requirement will only
become valid if the specified <code>arg</code>'s value equals <code>val</code>.</p>
<p><strong>NOTE:</strong> If using YAML the values should be laid out as follows</p>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_ok</span>()); <spanclass="comment">// We didn't use --other=special, so "cfg" wasn't required</span></pre></div>
<p>Setting [<code>Arg::required_if(arg, val)</code>] and having <code>arg</code> used with a value of <code>val</code> but <em>not</em>
</div><h4id='method.required_ifs'class="method"><codeid='required_ifs.v'>pub fn <ahref='#method.required_ifs'class='fnname'>required_ifs</a>(self, ifs: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</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.tuple.html">)</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1697-1710'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows specifying that an argument is <ahref="./struct.Arg.html#method.required">required</a> based on multiple conditions. The
conditions are set up in a <code>(arg, val)</code> style tuple. The requirement will only become valid
if one of the specified <code>arg</code>'s value equals it's corresponding <code>val</code>.</p>
<p><strong>NOTE:</strong> If using YAML the values should be laid out as follows</p>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_ok</span>()); <spanclass="comment">// We didn't use --option=spec, or --extra=val so "cfg" isn't required</span></pre></div>
<p>Setting [<code>Arg::required_ifs(&[(arg, val)])</code>] and having any of the <code>arg</code>s used with it's
value of <code>val</code> but <em>not</em> using this arg is an error.</p>
</div><h4id='method.requires_all'class="method"><codeid='requires_all.v'>pub fn <ahref='#method.requires_all'class='fnname'>requires_all</a>(self, names: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&'a <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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1774-1787'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets multiple arguments by names that are required when this one is present I.e. when
using this argument, the following arguments <em>must</em> be present.</p>
<p><strong>NOTE:</strong><ahref="./struct.Arg.html#method.conflicts_with">Conflicting</a> rules and <ahref="./struct.Arg.html#method.overrides_with">override</a> rules take precedence over being required
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">is_ok</span>()); <spanclass="comment">// We didn't use cfg, so input and output weren't required</span></pre></div>
<p>Setting [<code>Arg::requires_all(&[arg, arg2])</code>] and <em>not</em> supplying all the arguments is an
</div><h4id='method.takes_value'class="method"><codeid='takes_value.v'>pub fn <ahref='#method.takes_value'class='fnname'>takes_value</a>(self, tv: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1827-1833'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that the argument takes a value at run time.</p>
<p><strong>NOTE:</strong> values for arguments may be specified in any of the following methods</p>
<ul>
<li>Using a space such as <code>-o value</code> or <code>--option value</code></li>
<li>Using an equals and no space such as <code>-o=value</code> or <code>--option=value</code></li>
<li>Use a short and no space such as <code>-ovalue</code></li>
</ul>
<p><strong>NOTE:</strong> By default, args which allow <ahref="./struct.Arg.html#method.multiple">multiple values</a> are delimited by commas, meaning
<code>--option=val1,val2,val3</code> is three values for the <code>--option</code> argument. If you wish to
change the delimiter to another character you can use <ahref="./struct.Arg.html#method.value_delimiter"><code>Arg::value_delimiter(char)</code></a>,
alternatively you can turn delimiting values <strong>OFF</strong> by using <ahref="./struct.Arg.html#method.use_delimiter"><code>Arg::use_delimiter(false)</code></a></p>
</div><h4id='method.hide_possible_values'class="method"><codeid='hide_possible_values.v'>pub fn <ahref='#method.hide_possible_values'class='fnname'>hide_possible_values</a>(self, hide: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1863-1869'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies if the possible values of an argument should be displayed in the help text or
not. Defaults to <code>false</code> (i.e. show possible values)</p>
<p>This is useful for args with many values, or ones which are explained elsewhere in the
<p>If we were to run the above program with <code>--help</code> the <code>[values: fast, slow]</code> portion of
the help text would be omitted.</p>
</div><h4id='method.hide_default_value'class="method"><codeid='hide_default_value.v'>pub fn <ahref='#method.hide_default_value'class='fnname'>hide_default_value</a>(self, hide: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1897-1903'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies if the default value of an argument should be displayed in the help text or
not. Defaults to <code>false</code> (i.e. show default value)</p>
<p>This is useful when default behavior of an arg is explained elsewhere in the help text.</p>
<p>If we were to run the above program with <code>--help</code> the <code>[default: localhost]</code> portion of
the help text would be omitted.</p>
</div><h4id='method.index'class="method"><codeid='index.v'>pub fn <ahref='#method.index'class='fnname'>index</a>(self, idx: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#1952-1955'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the index of a positional argument <strong>starting at</strong> 1.</p>
<p><strong>NOTE:</strong> The index refers to position according to <strong>other positional argument</strong>. It does
not define position in the argument list as a whole.</p>
<p><strong>NOTE:</strong> If no <ahref="./struct.Arg.html#method.short"><code>Arg::short</code></a>, or <ahref="./struct.Arg.html#method.long"><code>Arg::long</code></a> have been defined, you can optionally
leave off the <code>index</code> method, and the index will be assigned in order of evaluation.
Utilizing the <code>index</code> method allows for setting indexes out of order</p>
<p><strong>NOTE:</strong> When utilized with <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a>, only the <strong>last</strong> positional argument
may be defined as multiple (i.e. with the highest index)</p>
<p>Although not in this method directly, <ahref="./struct.App.html"><code>App</code></a> will <ahref="https://doc.rust-lang.org/std/macro.panic!.html"><code>panic!</code></a> if indexes are skipped (such
as defining <code>index(1)</code> and <code>index(3)</code> but not <code>index(2)</code>, or a positional argument is
defined as multiple and is not the highest index</p>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">m</span>.<spanclass="ident">value_of</span>(<spanclass="string">"mode"</span>), <spanclass="prelude-val">Some</span>(<spanclass="string">"fast"</span>)); <spanclass="comment">// notice index(1) means "first positional"</span>
<spanclass="comment">// *not* first argument</span></pre></div>
</div><h4id='method.multiple'class="method"><codeid='multiple.v'>pub fn <ahref='#method.multiple'class='fnname'>multiple</a>(self, multi: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2148-2154'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that the argument may appear more than once. For flags, this results
in the number of occurrences of the flag being recorded. For example <code>-ddd</code> or <code>-d -d -d</code>
would count as three occurrences. For options there is a distinct difference in multiple
occurrences vs multiple values.</p>
<p>For example, <code>--opt val1 val2</code> is one occurrence, but two values. Whereas
<code>--opt val1 --opt val2</code> is two occurrences.</p>
<p><strong>WARNING:</strong></p>
<p>Setting <code>multiple(true)</code> for an <ahref="./struct.Arg.html#method.takes_value">option</a> with no other details, allows multiple values
<strong>and</strong> multiple occurrences because it isn't possible to have more occurrences than values
for options. Because multiple values are allowed, <code>--option val1 val2 val3</code> is perfectly
valid, be careful when designing a CLI where positional arguments are expected after a
option which accepts multiple values, as <code>clap</code> will continue parsing <em>values</em> until it
reaches the max or specific number of values defined, or another flag or option.</p>
<p><strong>Pro Tip</strong>:</p>
<p>It's possible to define an option which allows multiple occurrences, but only one value per
occurrence. To do this use <ahref="./struct.Arg.html#method.number_of_values"><code>Arg::number_of_values(1)</code></a> in coordination with
<p>When using args with <code>multiple(true)</code> on <ahref="./struct.Arg.html#method.takes_value">options</a> or <ahref="./struct.Arg.html#method.index">positionals</a> (i.e. those args that
accept values) and <ahref="./struct.SubCommand.html">subcommands</a>, one needs to consider the possibility of an argument value
being the same as a valid subcommand. By default <code>clap</code> will parse the argument in question
as a value <em>only if</em> a value is possible at that moment. Otherwise it will be parsed as a
subcommand. In effect, this means using <code>multiple(true)</code> with no additional parameters and
a possible value that coincides with a subcommand name, the subcommand cannot be called
unless another argument is passed first.</p>
<p>As an example, consider a CLI with an option <code>--ui-paths=<paths>...</code> and subcommand <code>signer</code></p>
<p>The following would be parsed as values to <code>--ui-paths</code>.</p>
<pre><codeclass="language-notrust">$ program --ui-paths path1 path2 signer
</code></pre>
<p>This is because <code>--ui-paths</code> accepts multiple values. <code>clap</code> will continue parsing values
until another argument is reached and it knows <code>--ui-paths</code> is done.</p>
<p>By adding additional parameters to <code>--ui-paths</code> we can solve this issue. Consider adding
<ahref="./struct.Arg.html#method.number_of_values"><code>Arg::number_of_values(1)</code></a> as discussed above. The following are all valid, and <code>signer</code>
is parsed as both a subcommand and a value in the second case.</p>
<pre><codeclass="language-notrust">$ program --ui-paths path1 signer
$ program --ui-paths path1 --ui-paths signer signer
<spanclass="string">"prog"</span>, <spanclass="string">"-v"</span>, <spanclass="string">"-v"</span>, <spanclass="string">"-v"</span><spanclass="comment">// note, -vvv would have same result</span>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">m</span>.<spanclass="ident">occurrences_of</span>(<spanclass="string">"file"</span>), <spanclass="number">1</span>); <spanclass="comment">// notice only one occurrence</span>
<spanclass="macro">assert</span><spanclass="macro">!</span>(<spanclass="op">!</span><spanclass="ident">m</span>.<spanclass="ident">is_present</span>(<spanclass="string">"word"</span>)); <spanclass="comment">// but we clearly used word!</span></pre></div>
<p>The problem is clap doesn't know when to stop parsing values for "files". This is further
compounded by if we'd said <code>word -F file1 file2</code> it would have worked fine, so it would
appear to only fail sometimes...not good!</p>
<p>A solution for the example above is to specify that <code>-F</code> only accepts one value, but is
<p>As a final example, notice if we define <ahref="./struct.Arg.html#method.number_of_values"><code>Arg::number_of_values(1)</code></a> and try to run the
problem example above, it would have been a runtime error with a pretty message to the
</div><h4id='method.value_terminator'class="method"><codeid='value_terminator.v'>pub fn <ahref='#method.value_terminator'class='fnname'>value_terminator</a>(self, term: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2201-2205'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies a value that <em>stops</em> parsing multiple values of a give argument. By default when
one sets <ahref="./struct.Arg.html#method.multiple"><code>multiple(true)</code></a> on an argument, clap will continue parsing values for that
argument until it reaches another valid argument, or one of the other more specific settings
for multiple values is used (such as <ahref="./struct.Arg.html#method.min_values"><code>min_values</code></a>, <ahref="./struct.Arg.html#method.max_values"><code>max_values</code></a> or
<p><strong>NOTE:</strong> This setting only applies to <ahref="./struct.Arg.html#method.takes_value">options</a> and <ahref="./struct.Arg.html#method.index">positional arguments</a></p>
<p><strong>NOTE:</strong> When the terminator is passed in on the command line, it is <strong>not</strong> stored as one
</div><h4id='method.global'class="method"><codeid='global.v'>pub fn <ahref='#method.global'class='fnname'>global</a>(self, g: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2250-2256'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that an argument can be matched to all child <ahref="./struct.SubCommand.html"><code>SubCommand</code></a>s.</p>
<p><strong>NOTE:</strong> Global arguments <em>only</em> propagate down, <strong>not</strong> up (to parent commands), however
their values once a user uses them will be propagated back up to parents. In effect, this
means one should <em>define</em> all global arguments at the top level, however it doesn't matter
where the user <em>uses</em> the global argument.</p>
</div><h4id='method.empty_values'class="method"><codeid='empty_values.v'>pub fn <ahref='#method.empty_values'class='fnname'>empty_values</a>(self, ev: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2292-2299'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows an argument to accept explicitly empty values. An empty value must be specified at
the command line with an explicit <code>""</code>, or <code>''</code></p>
<p><strong>NOTE:</strong> Defaults to <code>true</code> (Explicitly empty values are allowed)</p>
<p><strong>NOTE:</strong> Implicitly sets <ahref="./struct.Arg.html#method.takes_value"><code>Arg::takes_value(true)</code></a> when set to <code>false</code></p>
</div><h4id='method.possible_values'class="method"><codeid='possible_values.v'>pub fn <ahref='#method.possible_values'class='fnname'>possible_values</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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2399-2408'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies a list of possible values for this argument. At runtime, <code>clap</code> verifies that
only one of the specified values was used, or fails with an error message.</p>
<p><strong>NOTE:</strong> This setting only applies to <ahref="./struct.Arg.html#method.takes_value">options</a> and <ahref="./struct.Arg.html#method.index">positional arguments</a></p>
</div><h4id='method.possible_value'class="method"><codeid='possible_value.v'>pub fn <ahref='#method.possible_value'class='fnname'>possible_value</a>(self, name: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2463-2470'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies a possible value for this argument, one at a time. At runtime, <code>clap</code> verifies
that only one of the specified values was used, or fails with error message.</p>
<p><strong>NOTE:</strong> This setting only applies to <ahref="./struct.Arg.html#method.takes_value">options</a> and <ahref="./struct.Arg.html#method.index">positional arguments</a></p>
</div><h4id='method.case_insensitive'class="method"><codeid='case_insensitive.v'>pub fn <ahref='#method.case_insensitive'class='fnname'>case_insensitive</a>(self, ci: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2517-2523'title='goto source code'>[src]</a></h4><divclass='docblock'><p>When used with <ahref="../../structopt/clap/struct.Arg.html#method.possible_values"title="`Arg::possible_values`"><code>Arg::possible_values</code></a> it allows the argument value to pass validation even if
the case differs from that of the specified <code>possible_value</code>.</p>
<p><strong>Pro Tip:</strong> Use this setting with <ahref="./macro.arg_enum.html"><code>arg_enum!</code></a></p>
</div><h4id='method.group'class="method"><codeid='group.v'>pub fn <ahref='#method.group'class='fnname'>group</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2555-2562'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the name of the <ahref="./struct.ArgGroup.html"><code>ArgGroup</code></a> the argument belongs to.</p>
</div><h4id='method.number_of_values'class="method"><codeid='number_of_values.v'>pub fn <ahref='#method.number_of_values'class='fnname'>number_of_values</a>(self, qty: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2642-2646'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies how many values are required to satisfy this argument. For example, if you had a
<code>-f <file></code> argument where you wanted exactly 3 'files' you would set
<code>.number_of_values(3)</code>, and this argument wouldn't be satisfied unless the user provided
3 and only 3 values.</p>
<p><strong>NOTE:</strong> Does <em>not</em> require <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> to be set. Setting
<ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> would allow <code>-f <file><file><file> -f <file><file><file></code> where
as <em>not</em> setting <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> would only allow one occurrence of this argument.</p>
</div><h4id='method.validator'class="method"><codeid='validator.v'>pub fn <ahref='#method.validator'class='fnname'>validator</a><F>(self, f: F) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b><spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html"title="trait core::ops::function::Fn">Fn</a>(<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>> + 'static, </span></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2684-2690'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows one to perform a custom validation on the argument value. You provide a closure
which accepts a <ahref="https://doc.rust-lang.org/std/string/struct.String.html"><code>String</code></a> value, and return a <ahref="https://doc.rust-lang.org/std/result/enum.Result.html"><code>Result</code></a> where the <ahref="https://doc.rust-lang.org/std/result/enum.Result.html#variant.Err"><code>Err(String)</code></a> is a
message displayed to the user.</p>
<p><strong>NOTE:</strong> The error message does <em>not</em> need to contain the <code>error:</code> portion, only the
message as all errors will appear as
<code>error: Invalid value for '<arg>': <YOUR MESSAGE></code> where <code><arg></code> is replaced by the actual
arg, and <code><YOUR MESSAGE></code> is the <code>String</code> you return as the error.</p>
<p><strong>NOTE:</strong> There is a small performance hit for using validators, as they are implemented
with <ahref="https://doc.rust-lang.org/std/rc/struct.Rc.html"><code>Rc</code></a> pointers. And the value to be checked will be allocated an extra time in order
to to be passed to the closure. This performance hit is extremely minimal in the grand
<spanclass="prelude-val">Err</span>(<spanclass="ident">String</span>::<spanclass="ident">from</span>(<spanclass="string">"The value did not contain the required @ sigil"</span>))
</div><h4id='method.validator_os'class="method"><codeid='validator_os.v'>pub fn <ahref='#method.validator_os'class='fnname'>validator_os</a><F>(self, f: F) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b><spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html"title="trait core::ops::function::Fn">Fn</a>(&<aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</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>> + 'static, </span></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2722-2728'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Works identically to Validator but is intended to be used with values that could
<spanclass="prelude-val">Err</span>(<spanclass="ident">OsString</span>::<spanclass="ident">from</span>(<spanclass="string">"The value did not contain the required & sigil"</span>))
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">res</span>.<spanclass="ident">unwrap</span>().<spanclass="ident">value_of</span>(<spanclass="string">"file"</span>), <spanclass="prelude-val">Some</span>(<spanclass="string">"Fish & chips"</span>));</pre></div>
</div><h4id='method.max_values'class="method"><codeid='max_values.v'>pub fn <ahref='#method.max_values'class='fnname'>max_values</a>(self, qty: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2786-2790'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the <em>maximum</em> number of values are for this argument. For example, if you had a
<code>-f <file></code> argument where you wanted up to 3 'files' you would set <code>.max_values(3)</code>, and
this argument would be satisfied if the user provided, 1, 2, or 3 values.</p>
<p><strong>NOTE:</strong> This does <em>not</em> implicitly set <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a>. This is because
<code>-o val -o val</code> is multiple occurrences but a single value and <code>-o val1 val2</code> is a single
occurrence with multiple values. For positional arguments this <strong>does</strong> set
<ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> because there is no way to determine the difference between multiple
</div><h4id='method.min_values'class="method"><codeid='min_values.v'>pub fn <ahref='#method.min_values'class='fnname'>min_values</a>(self, qty: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2849-2852'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the <em>minimum</em> number of values for this argument. For example, if you had a
<code>-f <file></code> argument where you wanted at least 2 'files' you would set
<code>.min_values(2)</code>, and this argument would be satisfied if the user provided, 2 or more
values.</p>
<p><strong>NOTE:</strong> This does not implicitly set <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a>. This is because
<code>-o val -o val</code> is multiple occurrences but a single value and <code>-o val1 val2</code> is a single
occurrence with multiple values. For positional arguments this <strong>does</strong> set
<ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> because there is no way to determine the difference between multiple
</div><h4id='method.use_delimiter'class="method"><codeid='use_delimiter.v'>pub fn <ahref='#method.use_delimiter'class='fnname'>use_delimiter</a>(self, d: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2900-2913'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies whether or not an argument should allow grouping of multiple values via a
delimiter. I.e. should <code>--option=val1,val2,val3</code> be parsed as three values (<code>val1</code>, <code>val2</code>,
and <code>val3</code>) or as a single value (<code>val1,val2,val3</code>). Defaults to using <code>,</code> (comma) as the
value delimiter for all arguments that accept values (options and positional arguments)</p>
<p><strong>NOTE:</strong> The default is <code>false</code>. When set to <code>true</code> the default <ahref="./struct.Arg.html#method.value_delimiter"><code>Arg::value_delimiter</code></a>
</div><h4id='method.require_delimiter'class="method"><codeid='require_delimiter.v'>pub fn <ahref='#method.require_delimiter'class='fnname'>require_delimiter</a>(self, d: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#2987-2998'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that <em>multiple values</em> may only be set using the delimiter. This means if an
if an option is encountered, and no delimiter is found, it automatically assumed that no
additional values for that option follow. This is unlike the default, where it is generally
assumed that more values will follow regardless of whether or not a delimiter is used.</p>
<p><strong>NOTE:</strong> The default is <code>false</code>.</p>
<p><strong>NOTE:</strong> Setting this to true implies <ahref="./struct.Arg.html#method.use_delimiter"><code>Arg::use_delimiter(true)</code></a></p>
<p><strong>NOTE:</strong> It's a good idea to inform the user that use of a delimiter is required, either
</div><h4id='method.value_delimiter'class="method"><codeid='value_delimiter.v'>pub fn <ahref='#method.value_delimiter'class='fnname'>value_delimiter</a>(self, d: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3023-3033'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the separator to use when values are clumped together, defaults to <code>,</code> (comma).</p>
</div><h4id='method.value_names'class="method"><codeid='value_names.v'>pub fn <ahref='#method.value_names'class='fnname'>value_names</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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3094-3114'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specify multiple names for values of option arguments. These names are cosmetic only, used
for help and usage strings only. The names are <strong>not</strong> used to access arguments. The values
of the arguments are accessed in numeric order (i.e. if you specify two names <code>one</code> and
<code>two</code><code>one</code> will be the first matched value, <code>two</code> will be the second).</p>
<p>This setting can be very helpful when describing the type of input the user should be
using, such as <code>FILE</code>, <code>INTERFACE</code>, etc. Although not required, it's somewhat convention to
use all capital letters for the value name.</p>
<p><strong>Pro Tip:</strong> It may help to use <ahref="./struct.Arg.html#method.next_line_help"><code>Arg::next_line_help(true)</code></a> if there are long, or
multiple value names in order to not throw off the help text alignment of all options.</p>
<p><strong>NOTE:</strong> This implicitly sets <ahref="./struct.Arg.html#method.number_of_values"><code>Arg::number_of_values</code></a> if the number of value names is
greater than one. I.e. be aware that the number of "names" you set for the values, will be
the <em>exact</em> number of values required to satisfy this argument</p>
<p>Running the above program produces the following output</p>
<pre><codeclass="language-notrust">valnames
USAGE:
valnames [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--io-files <INFILE><OUTFILE> Some help text
</code></pre>
</div><h4id='method.value_name'class="method"><codeid='value_name.v'>pub fn <ahref='#method.value_name'class='fnname'>value_name</a>(self, name: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3162-3173'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the name for value of <ahref="./struct.Arg.html#method.takes_value">option</a> or <ahref="./struct.Arg.html#method.index">positional</a> arguments inside of help
documentation. This name is cosmetic only, the name is <strong>not</strong> used to access arguments.
This setting can be very helpful when describing the type of input the user should be
using, such as <code>FILE</code>, <code>INTERFACE</code>, etc. Although not required, it's somewhat convention to
<p>Running the above program produces the following output</p>
<pre><codeclass="language-notrust">valnames
USAGE:
valnames [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--config <FILE> Some help text
</code></pre>
</div><h4id='method.default_value'class="method"><codeid='default_value.v'>pub fn <ahref='#method.default_value'class='fnname'>default_value</a>(self, val: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3238-3240'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the value of the argument when <em>not</em> specified at runtime.</p>
<p><strong>NOTE:</strong> If the user <em>does not</em> use this argument at runtime, <ahref="./struct.ArgMatches.html#method.occurrences_of"><code>ArgMatches::occurrences_of</code></a>
will return <code>0</code> even though the <ahref="./struct.ArgMatches.html#method.value_of"><code>ArgMatches::value_of</code></a> will return the default specified.</p>
<p><strong>NOTE:</strong> If the user <em>does not</em> use this argument at runtime <ahref="./struct.ArgMatches.html#method.is_present"><code>ArgMatches::is_present</code></a> will
still return <code>true</code>. If you wish to determine whether the argument was used at runtime or
not, consider <ahref="./struct.ArgMatches.html#method.occurrences_of"><code>ArgMatches::occurrences_of</code></a> which will return <code>0</code> if the argument was <em>not</em>
used at runtime.</p>
<p><strong>NOTE:</strong> This setting is perfectly compatible with <ahref="./struct.Arg.html#method.default_value_if"><code>Arg::default_value_if</code></a> but slightly
different. <code>Arg::default_value</code><em>only</em> takes affect when the user has not provided this arg
at runtime. <code>Arg::default_value_if</code> however only takes affect when the user has not provided
a value at runtime <strong>and</strong> these other conditions are met as well. If you have set
<code>Arg::default_value</code> and <code>Arg::default_value_if</code>, and the user <strong>did not</strong> provide a this
arg at runtime, nor did were the conditions met for <code>Arg::default_value_if</code>, the
<code>Arg::default_value</code> will be applied.</p>
<p><strong>NOTE:</strong> This implicitly sets <ahref="./struct.Arg.html#method.takes_value"><code>Arg::takes_value(true)</code></a>.</p>
<p><strong>NOTE:</strong> This setting effectively disables <code>AppSettings::ArgRequiredElseHelp</code> if used in
conjunction as it ensures that some argument will always be present.</p>
</div><h4id='method.default_value_os'class="method"><codeid='default_value_os.v'>pub fn <ahref='#method.default_value_os'class='fnname'>default_value_os</a>(self, val: &'a <aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3246-3250'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Provides a default value in the exact same manner as <ahref="../../structopt/clap/struct.Arg.html#method.default_value"title="`Arg::default_value`"><code>Arg::default_value</code></a>
</div><h4id='method.default_value_if'class="method"><codeid='default_value_if.v'>pub fn <ahref='#method.default_value_if'class='fnname'>default_value_if</a>(<br> self, <br> arg: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> val: <aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, <br> default: &'b <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3348-3354'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies the value of the argument if <code>arg</code> has been used at runtime. If <code>val</code> is set to
<code>None</code>, <code>arg</code> only needs to be present. If <code>val</code> is set to <code>"some-val"</code> then <code>arg</code> must be
present at runtime <strong>and</strong> have the value <code>val</code>.</p>
<p><strong>NOTE:</strong> This setting is perfectly compatible with <ahref="./struct.Arg.html#method.default_value"><code>Arg::default_value</code></a> but slightly
different. <code>Arg::default_value</code><em>only</em> takes affect when the user has not provided this arg
at runtime. This setting however only takes affect when the user has not provided a value at
runtime <strong>and</strong> these other conditions are met as well. If you have set <code>Arg::default_value</code>
and <code>Arg::default_value_if</code>, and the user <strong>did not</strong> provide a this arg at runtime, nor did
were the conditions met for <code>Arg::default_value_if</code>, the <code>Arg::default_value</code> will be
applied.</p>
<p><strong>NOTE:</strong> This implicitly sets <ahref="./struct.Arg.html#method.takes_value"><code>Arg::takes_value(true)</code></a>.</p>
<p><strong>NOTE:</strong> If using YAML the values should be laid out as follows (<code>None</code> can be represented
</div><h4id='method.default_value_ifs_os'class="method"><codeid='default_value_ifs_os.v'>pub fn <ahref='#method.default_value_ifs_os'class='fnname'>default_value_ifs_os</a>(<br> self, <br> ifs: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'b <aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>>, &'b <aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3478-3483'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Provides multiple conditional default values in the exact same manner as
<ahref="../../structopt/clap/struct.Arg.html#method.default_value_ifs"title="`Arg::default_value_ifs`"><code>Arg::default_value_ifs</code></a> only using [<code>OsStr</code>]s instead.
</div><h4id='method.env'class="method"><codeid='env.v'>pub fn <ahref='#method.env'class='fnname'>env</a>(self, name: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3590-3592'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that if the value is not passed in as an argument, that it should be retrieved
from the environment, if available. If it is not present in the environment, then default
rules will apply.</p>
<p><strong>NOTE:</strong> If the user <em>does not</em> use this argument at runtime, <ahref="./struct.ArgMatches.html#method.occurrences_of"><code>ArgMatches::occurrences_of</code></a>
will return <code>0</code> even though the <ahref="./struct.ArgMatches.html#method.value_of"><code>ArgMatches::value_of</code></a> will return the default specified.</p>
<p><strong>NOTE:</strong> If the user <em>does not</em> use this argument at runtime <ahref="./struct.ArgMatches.html#method.is_present"><code>ArgMatches::is_present</code></a> will
return <code>true</code> if the variable is present in the environment . If you wish to determine whether
the argument was used at runtime or not, consider <ahref="./struct.ArgMatches.html#method.occurrences_of"><code>ArgMatches::occurrences_of</code></a> which will
return <code>0</code> if the argument was <em>not</em> used at runtime.</p>
<p><strong>NOTE:</strong> This implicitly sets <ahref="./struct.Arg.html#method.takes_value"><code>Arg::takes_value(true)</code></a>.</p>
<p><strong>NOTE:</strong> If <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> is set then <ahref="./struct.Arg.html#method.use_delimiter"><code>Arg::use_delimiter(true)</code></a> should also be
set. Otherwise, only a single argument will be returned from the environment variable. The
default delimiter is <code>,</code> and follows all the other delimiter rules.</p>
</div><h4id='method.env_os'class="method"><codeid='env_os.v'>pub fn <ahref='#method.env_os'class='fnname'>env_os</a>(self, name: &'a <aclass="struct"href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3597-3602'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Specifies that if the value is not passed in as an argument, that it should be retrieved
from the environment if available in the exact same manner as <ahref="../../structopt/clap/struct.Arg.html#method.env"title="`Arg::env`"><code>Arg::env</code></a> only using
</div><h4id='method.next_line_help'class="method"><codeid='next_line_help.v'>pub fn <ahref='#method.next_line_help'class='fnname'>next_line_help</a>(self, nlh: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3658-3665'title='goto source code'>[src]</a></h4><divclass='docblock'><p>When set to <code>true</code> the help string will be displayed on the line after the argument and
indented once. This can be helpful for arguments with very long or complex help messages.
This can also be helpful for arguments with very long flag names, or many/long value names.</p>
<p><strong>NOTE:</strong> To apply this setting to all arguments consider using
</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>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3722-3725'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Allows custom ordering of args within the help message. Args with a lower value will be
displayed first in the help message. This is helpful when one would like to emphasise
frequently used args, or prioritize those towards the top of the list. Duplicate values
<strong>are</strong> allowed. Args with duplicate display orders will be displayed in alphabetical
order.</p>
<p><strong>NOTE:</strong> The default is 999 for all arguments.</p>
<p><strong>NOTE:</strong> This setting is ignored for <ahref="./struct.Arg.html#method.index">positional arguments</a> which are always displayed in
.<spanclass="ident">arg</span>(<spanclass="ident">Arg</span>::<spanclass="ident">with_name</span>(<spanclass="string">"a"</span>) <spanclass="comment">// Typically args are grouped alphabetically by name.</span>
<spanclass="comment">// Args without a display_order have a value of 999 and are</span>
<spanclass="comment">// displayed alphabetically with all other 999 valued args.</span>
<p>The above example displays the following help message</p>
<pre><codeclass="language-notrust">cust-ord
USAGE:
cust-ord [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-O, --other-option <b> I should be first!
-o, --long-option <a> Some help and text
</code></pre>
</div><h4id='method.raw'class="method"><codeid='raw.v'>pub fn <ahref='#method.raw'class='fnname'>raw</a>(self, raw: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3746-3748'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Indicates that all parameters passed after this should not be parsed
individually, but rather passed in their entirety. It is worth noting
that setting this requires all values to come after a <code>--</code> to indicate they
<p>Will result in everything after <code>--</code> to be considered one raw argument. This behavior
may not be exactly what you are expecting and using <ahref="./enum.AppSettings.html#variant.TrailingVarArg"><code>AppSettings::TrailingVarArg</code></a>
may be more appropriate.</p>
<p><strong>NOTE:</strong> Implicitly sets <ahref="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a>, <ahref="./struct.Arg.html#method.allow_hyphen_values"><code>Arg::allow_hyphen_values(true)</code></a>, and
<ahref="./struct.Arg.html#method.last"><code>Arg::last(true)</code></a> when set to <code>true</code></p>
</div><h4id='method.hidden_short_help'class="method"><codeid='hidden_short_help.v'>pub fn <ahref='#method.hidden_short_help'class='fnname'>hidden_short_help</a>(self, hide: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3819-3825'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Hides an argument from short help message output.</p>
<p><strong>NOTE:</strong> This does <strong>not</strong> hide the argument from usage strings on error</p>
<p><strong>NOTE:</strong> Setting this option will cause next-line-help output style to be used
when long help (<code>--help</code>) is called.</p>
--config Some help text describing the --config arg
-h, --help Prints help information
-V, --version Prints version information
</code></pre>
</div><h4id='method.hidden_long_help'class="method"><codeid='hidden_long_help.v'>pub fn <ahref='#method.hidden_long_help'class='fnname'>hidden_long_help</a>(self, hide: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3896-3902'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Hides an argument from long help message output.</p>
<p><strong>NOTE:</strong> This does <strong>not</strong> hide the argument from usage strings on error</p>
<p><strong>NOTE:</strong> Setting this option will cause next-line-help output style to be used
when long help (<code>--help</code>) is called.</p>
--config Some help text describing the --config arg
-h, --help Prints help information
-V, --version Prints version information
</code></pre>
</div><h4id='method.is_set'class="method"><codeid='is_set.v'>pub fn <ahref='#method.is_set'class='fnname'>is_set</a>(&self, s: <aclass="enum"href="../../structopt/clap/enum.ArgSettings.html"title="enum structopt::clap::ArgSettings">ArgSettings</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3907-3909'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Checks if one of the <ahref="./enum.ArgSettings.html"><code>ArgSettings</code></a> settings is set for the argument.</p>
</div><h4id='method.set'class="method"><codeid='set.v'>pub fn <ahref='#method.set'class='fnname'>set</a>(self, s: <aclass="enum"href="../../structopt/clap/enum.ArgSettings.html"title="enum structopt::clap::ArgSettings">ArgSettings</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3914-3917'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Sets one of the <ahref="./enum.ArgSettings.html"><code>ArgSettings</code></a> settings for the argument.</p>
</div><h4id='method.unset'class="method"><codeid='unset.v'>pub fn <ahref='#method.unset'class='fnname'>unset</a>(self, s: <aclass="enum"href="../../structopt/clap/enum.ArgSettings.html"title="enum structopt::clap::ArgSettings">ArgSettings</a>) -><aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'a, 'b></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3922-3925'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Unsets one of the <ahref="./enum.ArgSettings.html"><code>ArgSettings</code></a> settings for the argument.</p>
</div></div><h2id='implementations'class='small-section-header'>Trait Implementations<ahref='#implementations'class='anchor'></a></h2><divid='implementations-list'><h3id='impl-PartialEq%3CArg%3C%27n%2C%20%27e%3E%3E'class='impl'><codeclass='in-band'>impl<'n, 'e><aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'n, 'e>> for <aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'n, 'e></code><ahref='#impl-PartialEq%3CArg%3C%27n%2C%20%27e%3E%3E'class='anchor'></a><aclass='srclink'href='../../src/clap/args/arg.rs.html#3950-3954'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.eq'class="method hidden"><codeid='eq.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq'class='fnname'>eq</a>(&self, other: &<aclass="struct"href="../../structopt/clap/struct.Arg.html"title="struct structopt::clap::Arg">Arg</a><'n, 'e>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><aclass='srclink'href='../../src/clap/args/arg.rs.html#3951-3953'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <ahref="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">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="structopt";</script><scriptsrc="../../aliases.js"></script><scriptsrc="../../main.js"></script><scriptdefersrc="../../search-index.js"></script></body></html>