#[non_exhaustive]pub enum NArgs {
Fixed(usize),
ZeroOrMore,
OneOrMore,
Optional,
AtLeast(usize),
}Expand description
How many arguments a positional slot or keyword takes.
In TOML this can be written as:
- integer
nargs = 1→Fixed(1) "*"→ZeroOrMore"+"→OneOrMore"?"→Optional"N+"e.g."2+"→AtLeast(2)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fixed(usize)
Exactly n positional arguments. Fixed(0) means a
keyword-only marker (no values of its own).
ZeroOrMore
Zero or more positional arguments — the keyword may appear alone or be followed by any number of values until the next sibling keyword. The default.
OneOrMore
One or more positional arguments. CMake requires at least one value; the splitter force-consumes the first value regardless of token classification so a value that spells a sibling keyword name is still captured.
Optional
Either zero or one positional argument.
AtLeast(usize)
At least n positional arguments; additional values are
consumed until the next sibling keyword.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NArgs
impl<'de> Deserialize<'de> for NArgs
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NArgs
impl StructuralPartialEq for NArgs
Auto Trait Implementations§
impl Freeze for NArgs
impl RefUnwindSafe for NArgs
impl Send for NArgs
impl Sync for NArgs
impl Unpin for NArgs
impl UnsafeUnpin for NArgs
impl UnwindSafe for NArgs
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.