pub struct Features {Show 27 fields
test_dummy_stable: bool,
test_dummy_unstable: bool,
alternative_registries: bool,
edition: bool,
rename_dependency: bool,
publish_lockfile: bool,
profile_overrides: bool,
default_run: bool,
metabuild: bool,
public_dependency: bool,
named_profiles: bool,
resolver: bool,
strip: bool,
rust_version: bool,
edition2021: bool,
per_package_target: bool,
codegen_backend: bool,
different_binary_name: bool,
profile_rustflags: bool,
workspace_inheritance: bool,
edition2024: bool,
trim_paths: bool,
open_namespaces: bool,
path_bases: bool,
activated: Vec<String>,
nightly_features_allowed: bool,
is_local: bool,
}
Expand description
Unstable feature context for querying if a new Cargo.toml syntax is allowed to use.
See the module-level documentation for the usage.
Fields§
§test_dummy_stable: bool
§test_dummy_unstable: bool
§alternative_registries: bool
§edition: bool
§rename_dependency: bool
§publish_lockfile: bool
§profile_overrides: bool
§default_run: bool
§metabuild: bool
§public_dependency: bool
§named_profiles: bool
§resolver: bool
§strip: bool
§rust_version: bool
§edition2021: bool
§per_package_target: bool
§codegen_backend: bool
§different_binary_name: bool
§profile_rustflags: bool
§workspace_inheritance: bool
§edition2024: bool
§trim_paths: bool
§open_namespaces: bool
§path_bases: bool
§activated: Vec<String>
The current activated features.
nightly_features_allowed: bool
Whether is allowed to use any unstable features.
is_local: bool
Whether the source manifest is from a local package.
Implementations§
Source§impl Features
impl Features
Sourcepub fn new(
features: &[String],
gctx: &GlobalContext,
warnings: &mut Vec<String>,
is_local: bool,
) -> CargoResult<Features>
pub fn new( features: &[String], gctx: &GlobalContext, warnings: &mut Vec<String>, is_local: bool, ) -> CargoResult<Features>
Creates a new unstable features context.
fn add( &mut self, feature_name: &str, gctx: &GlobalContext, warnings: &mut Vec<String>, ) -> CargoResult<()>
Sourcepub fn require(&self, feature: &Feature) -> CargoResult<()>
pub fn require(&self, feature: &Feature) -> CargoResult<()>
Checks if the given feature is enabled.
Sourcepub fn is_enabled(&self, feature: &Feature) -> bool
pub fn is_enabled(&self, feature: &Feature) -> bool
Whether the given feature is allowed to use in this context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Features
impl RefUnwindSafe for Features
impl Send for Features
impl Sync for Features
impl Unpin for Features
impl UnwindSafe for Features
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes