Enum serde_yaml::Value
[−]
[src]
pub enum Value { Null, Bool(bool), I64(i64), F64(f64), String(String), Sequence(Sequence), Mapping(Mapping), }
Represents any valid YAML value.
Variants
Null
Represents a YAML null value.
Bool(bool)
Represents a YAML boolean.
I64(i64)
Represents a YAML integer value.
F64(f64)
Represents a YAML floating-point value.
String(String)
Represents a YAML string.
Sequence(Sequence)
Represents a YAML sequence in which the elements are
serde_yaml::Value
.
Mapping(Mapping)
Represents a YAML mapping in which the keys and values are both
serde_yaml::Value
.
Methods
impl Value
[src]
fn is_null(&self) -> bool
fn is_bool(&self) -> bool
fn as_bool(&self) -> Option<bool>
fn is_i64(&self) -> bool
fn as_i64(&self) -> Option<i64>
fn is_f64(&self) -> bool
fn as_f64(&self) -> Option<f64>
fn is_string(&self) -> bool
fn as_str(&self) -> Option<&str>
fn is_sequence(&self) -> bool
fn as_sequence(&self) -> Option<&Sequence>
fn as_sequence_mut(&mut self) -> Option<&mut Sequence>
fn is_mapping(&self) -> bool
fn as_mapping(&self) -> Option<&Mapping>
fn as_mapping_mut(&mut self) -> Option<&mut Mapping>
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialOrd for Value
[src]
fn partial_cmp(&self, __arg_0: &Value) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Value) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Value) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Value) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Value) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Debug for Value
[src]
impl From<Yaml> for Value
[src]
fn from(yaml: Yaml) -> Self
Performs the conversion.
impl Serialize for Value
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer
Serialize this value into the given Serde serializer. Read more
impl Deserialize for Value
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer
Deserialize this value from the given Serde deserializer. Read more
impl PartialEq for Value
[src]
fn eq(&self, other: &Value) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Eq for Value
[src]
impl Hash for Value
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Deserializer for Value
[src]
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
fn deserialize<V>(self, visitor: V) -> Result<V::Value, Error> where V: Visitor
Require the Deserializer
to figure out how to drive the visitor based on what data type is in the input. Read more
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error> where V: Visitor
Hint that the Deserialize
type is expecting an optional value. Read more
fn deserialize_enum<V>(self,
_name: &str,
_variants: &'static [&'static str],
visitor: V)
-> Result<V::Value, Error> where V: Visitor
_name: &str,
_variants: &'static [&'static str],
visitor: V)
-> Result<V::Value, Error> where V: Visitor
Hint that the Deserialize
type is expecting an enum value with a particular name and possible variants. Read more
fn deserialize_newtype_struct<V>(self,
_name: &'static str,
visitor: V)
-> Result<V::Value, Self::Error> where V: Visitor
_name: &'static str,
visitor: V)
-> Result<V::Value, Self::Error> where V: Visitor
Hint that the Deserialize
type is expecting a newtype struct with a particular name. Read more
fn deserialize_bool<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a bool
value.
fn deserialize_u8<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a u8
value.
fn deserialize_u16<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a u16
value.
fn deserialize_u32<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a u32
value.
fn deserialize_u64<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a u64
value.
fn deserialize_i8<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting an i8
value.
fn deserialize_i16<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting an i16
value.
fn deserialize_i32<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting an i32
value.
fn deserialize_i64<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting an i64
value.
fn deserialize_f32<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a f32
value.
fn deserialize_f64<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a f64
value.
fn deserialize_char<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a char
value.
fn deserialize_str<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer
. Read more
fn deserialize_string<__V>(self,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer
. Read more
fn deserialize_unit<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a unit value.
fn deserialize_seq<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a sequence of values.
fn deserialize_seq_fixed_size<__V>(self,
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more
fn deserialize_bytes<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer
. Read more
fn deserialize_byte_buf<__V>(self,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer
. Read more
fn deserialize_map<__V>(self, visitor: __V) -> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a map of key-value pairs.
fn deserialize_unit_struct<__V>(self,
_: &'static str,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
_: &'static str,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a unit struct with a particular name. Read more
fn deserialize_tuple_struct<__V>(self,
_: &'static str,
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
_: &'static str,
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a tuple struct with a particular name and number of fields. Read more
fn deserialize_struct<__V>(self,
_: &'static str,
_: &'static [&'static str],
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
_: &'static str,
_: &'static [&'static str],
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a struct with a particular name and fields. Read more
fn deserialize_struct_field<__V>(self,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting the name of a struct field. Read more
fn deserialize_tuple<__V>(self,
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
_: usize,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type is expecting a tuple value with a particular number of elements. Read more
fn deserialize_ignored_any<__V>(self,
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
visitor: __V)
-> Result<__V::Value, Self::Error> where __V: Visitor
Hint that the Deserialize
type needs to deserialize a value whose type doesn't matter because it is ignored. Read more