pub enum CommandArg {
Literal(Value),
Label(String),
}Expand description
A parsed constraint command argument, preserving the literal kind from the
grammar rule command_arg: { number_literal | boolean_literal | text_literal | label }.
Two grammatical kinds appear after a constraint command:
- Literal — a fully-typed value carrying the literal kind the parser
recognised (
Number,Ratio,Scale,Duration,Date,Time,Boolean,Text). Stored as the canonicalcrate::literals::Valueso downstream consumers match on the variant rather than re-parsing strings. - Label — a bare identifier used as a name (e.g. the unit name
eurinunit eur 1.00, or a primitive type keyword used as an option label).
Planning validates each command’s args against the variant kinds it accepts
and rejects mismatches without coercion (a Text literal is never a Number,
a Ratio literal is never a bare Number, etc.).
Variants§
Literal(Value)
A typed literal value parsed by [crate::parsing::parser::Parser::parse_literal_value].
Label(String)
An identifier used as a name (unit name, option keyword, etc.).
Trait Implementations§
Source§impl Clone for CommandArg
impl Clone for CommandArg
Source§fn clone(&self) -> CommandArg
fn clone(&self) -> CommandArg
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandArg
impl Debug for CommandArg
Source§impl<'de> Deserialize<'de> for CommandArg
impl<'de> Deserialize<'de> for CommandArg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CommandArg
impl Display for CommandArg
Source§impl PartialEq for CommandArg
impl PartialEq for CommandArg
Source§impl Serialize for CommandArg
impl Serialize for CommandArg
impl Eq for CommandArg
impl StructuralPartialEq for CommandArg
Auto Trait Implementations§
impl Freeze for CommandArg
impl RefUnwindSafe for CommandArg
impl Send for CommandArg
impl Sync for CommandArg
impl Unpin for CommandArg
impl UnsafeUnpin for CommandArg
impl UnwindSafe for CommandArg
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.