Function list_enabled

Source
pub fn list_enabled() -> Vec<String>
Expand description

Returns the list of enabled features as a Vec<String>.

Reads from std::env::vars and filters the features based on those listed in Cargo.toml. This function should only be called in build scripts or code executed during a Cargo build process, as the required CARGO_FEATURE_* environment variables will be missing otherwise.

Unless its output format doesn’t suit you, you’ll probably want to use list_enabled_as_string instead.

See also list_enabled_with_path.

§Panics

Panics if the Cargo.toml file cannot be read.

§Returns

A Vec<String> containing the names of the enabled features, ordered with default first and then sorted alphabetically.