pub enum ValueType {
Primitive(PrimitiveValue),
Array(Vec<ValuePrimitiveType>),
Nested(Map<String, ValueType>),
}Expand description
Supports primitive types string, number, boolean, null
May be an array of those primitive types, or an object whose values are only primitives
Object keys are always strings, values can be any basic type, an array, or a nested object.
Array values must all be the same type.
Variants§
Primitive(PrimitiveValue)
A primitive value
Array(Vec<ValuePrimitiveType>)
An array of values
Nested(Map<String, ValueType>)
A nested object
Implementations§
Source§impl ValueType
impl ValueType
Sourcepub fn default_from_shape(shape: &ShapeType) -> ValueType
pub fn default_from_shape(shape: &ShapeType) -> ValueType
Get the default value type from a shape
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ValueType
impl<'de> Deserialize<'de> for ValueType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValueType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValueType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&PrimitiveValue> for ValueType
impl From<&PrimitiveValue> for ValueType
Source§fn from(mval: &PrimitiveValue) -> ValueType
fn from(mval: &PrimitiveValue) -> ValueType
Converts to this type from the input type.
Source§impl From<&ValueType> for PrimitiveValue
impl From<&ValueType> for PrimitiveValue
Source§fn from(val: &ValueType) -> PrimitiveValue
fn from(val: &ValueType) -> PrimitiveValue
Converts to this type from the input type.
Source§impl Interpolate for ValueType
impl Interpolate for ValueType
Source§impl Serialize for ValueType
impl Serialize for ValueType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ValueType
Auto Trait Implementations§
impl Freeze for ValueType
impl RefUnwindSafe for ValueType
impl Send for ValueType
impl Sync for ValueType
impl Unpin for ValueType
impl UnwindSafe for ValueType
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