pub enum CliValue {
Bool(bool),
String(String),
I64(i64),
FiniteF64(f64),
Json(String),
List(Vec<CliValue>),
}Expand description
A typed value produced by a built CLI registry.
Json deliberately holds the argument’s raw source text rather than a
parsed serde_json::Value. AFDATA turns on serde_json/arbitrary_precision
and that feature unifies across a whole binary, so a parsed value’s number
semantics would depend on which other crates happen to be linked in. The
text is validated as one JSON value at parse time; deciding what its numbers
mean is the caller’s choice.
Variants§
Implementations§
Source§impl CliValue
impl CliValue
pub fn as_bool(&self) -> Option<bool>
pub fn as_str(&self) -> Option<&str>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
Sourcepub fn as_json_str(&self) -> Option<&str>
pub fn as_json_str(&self) -> Option<&str>
The raw, still-unparsed JSON source text of a json argument.
pub fn as_list(&self) -> Option<&[CliValue]>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CliValue
impl<'de> Deserialize<'de> for CliValue
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
impl StructuralPartialEq for CliValue
Auto Trait Implementations§
impl Freeze for CliValue
impl RefUnwindSafe for CliValue
impl Send for CliValue
impl Sync for CliValue
impl Unpin for CliValue
impl UnsafeUnpin for CliValue
impl UnwindSafe for CliValue
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