pub enum SpecValue {
Integer(i64),
Float(f64),
Bool(bool),
Text(String),
}Expand description
A parameter value as written in a spec file.
Variants§
Integer(i64)
Integer, as in 3.
Float(f64)
Float, as in 0.1.
Bool(bool)
true or false.
Text(String)
String, as in a choice’s option name.
Implementations§
Source§impl SpecValue
impl SpecValue
Sourcepub fn to_text(&self) -> String
pub fn to_text(&self) -> String
Returns the value as text in the form that --set accepts.
A float is written in its shortest round-trip form, as in 0.1.
Sourcepub fn from_text(text: &str) -> Self
pub fn from_text(text: &str) -> Self
Returns text as the value Self::to_text writes back as text.
Text that parses as an integer, a finite float or a bool, and is written back unchanged, becomes that kind of value. Anything else stays text.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpecValue
impl<'de> Deserialize<'de> for SpecValue
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for SpecValue
Auto Trait Implementations§
impl Freeze for SpecValue
impl RefUnwindSafe for SpecValue
impl Send for SpecValue
impl Sync for SpecValue
impl Unpin for SpecValue
impl UnsafeUnpin for SpecValue
impl UnwindSafe for SpecValue
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<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 more