pub enum Argument {
Bracket(BracketArgument),
Quoted(String),
Unquoted(String),
InlineComment(Comment),
}Expand description
A single argument (or inline comment) in an argument list.
Variants§
Bracket(BracketArgument)
[[...]], [=[...]=], etc. Content is verbatim.
Quoted(String)
"..." — includes the surrounding quotes verbatim.
Unquoted(String)
Any other token — unquoted argument, variable reference
(${VAR}), environment reference ($ENV{X}), cache reference
($CACHE{X}), generator expression ($<...>), legacy
unquoted arguments containing embedded "..." segments, or a
parenthesised group inside a condition (e.g. (A OR B)
inside if(...)).
InlineComment(Comment)
A comment that appears inline between arguments.
Implementations§
Source§impl Argument
impl Argument
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The source text of this argument. For
Argument::InlineComment the returned slice includes the
leading # (and, for bracket comments, the enclosing
#[[...]] delimiters).
Sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
Returns true when the argument is an inline comment placeholder rather
than a normal CMake argument token.
Trait Implementations§
impl Eq for Argument
impl StructuralPartialEq for Argument
Auto Trait Implementations§
impl Freeze for Argument
impl RefUnwindSafe for Argument
impl Send for Argument
impl Sync for Argument
impl Unpin for Argument
impl UnsafeUnpin for Argument
impl UnwindSafe for Argument
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.