Enum rustdoc::clean::cfg::Cfg [−][src]
pub enum Cfg { True, False, Cfg(Symbol, Option<Symbol>), Not(Box<Cfg>), Any(Vec<Cfg>), All(Vec<Cfg>), }
Variants
True
Accepts all configurations.
False
Denies all configurations.
Cfg(Symbol, Option<Symbol>)
A generic configration option, e.g. test
or target_os = "linux"
.
Not(Box<Cfg>)
Negate a configuration requirement, i.e. not(x)
.
Any(Vec<Cfg>)
Union of a list of configuration requirements, i.e. any(...)
.
All(Vec<Cfg>)
Intersection of a list of configuration requirements, i.e. all(...)
.
Methods
impl Cfg
[src]
impl Cfg
fn parse_nested(nested_cfg: &NestedMetaItem) -> Result<Cfg, InvalidCfgError>
[src]
fn parse_nested(nested_cfg: &NestedMetaItem) -> Result<Cfg, InvalidCfgError>
Parses a NestedMetaItem
into a Cfg
.
pub fn parse(cfg: &MetaItem) -> Result<Cfg, InvalidCfgError>
[src]
pub fn parse(cfg: &MetaItem) -> Result<Cfg, InvalidCfgError>
Parses a MetaItem
into a Cfg
.
The MetaItem
should be the content of the #[cfg(...)]
, e.g. unix
or
target_os = "redox"
.
If the content is not properly formatted, it will return an error indicating what and where the error is.
pub fn matches(
&self,
parse_sess: &ParseSess,
features: Option<&Features>
) -> bool
[src]
pub fn matches(
&self,
parse_sess: &ParseSess,
features: Option<&Features>
) -> bool
Checks whether the given configuration can be matched in the current session.
Equivalent to attr::cfg_matches
.
fn is_simple(&self) -> bool
[src]
fn is_simple(&self) -> bool
Whether the configuration consists of just Cfg
or Not
.
fn is_all(&self) -> bool
[src]
fn is_all(&self) -> bool
Whether the configuration consists of just Cfg
, Not
or All
.
pub(crate) fn render_short_html(&self) -> String
[src]
pub(crate) fn render_short_html(&self) -> String
Renders the configuration for human display, as a short HTML description.
pub(crate) fn render_long_html(&self) -> String
[src]
pub(crate) fn render_long_html(&self) -> String
Renders the configuration for long display, as a long HTML description.
fn should_capitalize_first_letter(&self) -> bool
[src]
fn should_capitalize_first_letter(&self) -> bool
fn should_append_only_to_description(&self) -> bool
[src]
fn should_append_only_to_description(&self) -> bool
fn should_use_with_in_description(&self) -> bool
[src]
fn should_use_with_in_description(&self) -> bool
Trait Implementations
impl Clone for Cfg
[src]
impl Clone for Cfg
fn clone(&self) -> Cfg
[src]
fn clone(&self) -> Cfg
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Encodable for Cfg
[src]
impl Encodable for Cfg
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Decodable for Cfg
[src]
impl Decodable for Cfg
fn decode<__D: Decoder>(d: &mut __D) -> Result<Cfg, __D::Error>
[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Cfg, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Debug for Cfg
[src]
impl Debug for Cfg
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Cfg
[src]
impl PartialEq for Cfg
fn eq(&self, other: &Cfg) -> bool
[src]
fn eq(&self, other: &Cfg) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Cfg) -> bool
[src]
fn ne(&self, other: &Cfg) -> bool
This method tests for !=
.
impl Eq for Cfg
[src]
impl Eq for Cfg
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Hash for Cfg
[src]
impl Hash for Cfg
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Not for Cfg
[src]
impl Not for Cfg
type Output = Cfg
The resulting type after applying the !
operator.
fn not(self) -> Cfg
[src]
fn not(self) -> Cfg
Performs the unary !
operation.
impl BitAndAssign for Cfg
[src]
impl BitAndAssign for Cfg
fn bitand_assign(&mut self, other: Cfg)
[src]
fn bitand_assign(&mut self, other: Cfg)
Performs the &=
operation.
impl BitAnd for Cfg
[src]
impl BitAnd for Cfg
type Output = Cfg
The resulting type after applying the &
operator.
fn bitand(self, other: Cfg) -> Cfg
[src]
fn bitand(self, other: Cfg) -> Cfg
Performs the &
operation.
impl BitOrAssign for Cfg
[src]
impl BitOrAssign for Cfg
fn bitor_assign(&mut self, other: Cfg)
[src]
fn bitor_assign(&mut self, other: Cfg)
Performs the |=
operation.
impl BitOr for Cfg
[src]
impl BitOr for Cfg