Enum compose_spec::Value
source · pub enum Value {
String(String),
Number(Number),
Bool(bool),
}
Expand description
A single string, number, or boolean value.
Variants§
Implementations§
source§impl Value
impl Value
sourcepub fn parse<T>(string: T) -> Self
pub fn parse<T>(string: T) -> Self
Parse the given string into a Value
.
First, it is attempted to parse the string into one of Value
s non-string types.
If each of those attempts fails, a Value::String
is returned.
In comparison, the From<&str>
and From<String>
implementations will always return
Value::String
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
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
source§impl PartialEq for Value
impl PartialEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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