[−][src]Struct cargo::core::CliUnstable
A parsed representation of all unstable flags that Cargo accepts.
Cargo, like rustc
, accepts a suite of -Z
flags which are intended for
gating unstable functionality to Cargo. These flags are only available on
the nightly channel of Cargo.
This struct doesn't have quite the same convenience macro that the features have above, but the procedure should still be relatively stable for adding a new unstable flag:
-
First, add a field to this
CliUnstable
structure. All flags are allowed to have a value as the-Z
flags are either of the form-Z foo
or-Z foo=bar
, and it's up to you how to parsebar
. -
Add an arm to the match statement in
CliUnstable::add
below to match on your new flag. The key (k
) is what you're matching on and the value is inv
. -
(optional) Add a new parsing function to parse your datatype. As of now there's an example for
bool
, but more can be added! -
In Cargo use
config.cli_unstable()
to get a reference to this structure and then test for your flag or your value and act accordingly.
If you have any trouble with this, please let us know!
Fields
print_im_a_teapot: bool
unstable_options: bool
offline: bool
no_index_update: bool
avoid_dev_deps: bool
minimal_versions: bool
package_features: bool
advanced_env: bool
config_profile: bool
Methods
impl CliUnstable
[src]
Trait Implementations
Auto Trait Implementations
impl Send for CliUnstable
impl Sync for CliUnstable
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self