[−][src]Enum serde_yaml::Value
Represents any valid YAML value.
Variants
NullRepresents a YAML null value.
Bool(bool)Represents a YAML boolean.
Number(Number)Represents a YAML numerical value, whether integer or floating point.
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]
impl Valuepub fn get<I: Index>(&self, index: I) -> Option<&Value>[src]
pub fn get<I: Index>(&self, index: I) -> Option<&Value>Index into a YAML sequence or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an sequence.
Returns None if the type of self does not match the type of the
index, for example if the index is a string and self is a sequence or
a number. Also returns None if the given key does not exist in the map
or the given index is not within the bounds of the sequence.
let object: Value = yaml(r#"{ A: 65, B: 66, C: 67 }"#); let x = object.get("A").unwrap(); assert_eq!(x, 65); let sequence: Value = yaml(r#"[ "A", "B", "C" ]"#); let x = sequence.get(2).unwrap(); assert_eq!(x, &Value::String("C".into())); assert_eq!(sequence.get("A"), None);
Square brackets can also be used to index into a value in a more concise
way. This returns Value::Null in cases where get would have returned
None.
let object = yaml(r#" --- A: [a, á, à] B: [b, b́] C: [c, ć, ć̣, ḉ] 42: true "#); assert_eq!(object["B"][0], Value::String("b".into())); assert_eq!(object[Value::String("D".into())], Value::Null); assert_eq!(object["D"], Value::Null); assert_eq!(object[0]["x"]["y"]["z"], Value::Null); assert_eq!(object[42], Value::Bool(true));
pub fn is_null(&self) -> bool[src]
pub fn is_null(&self) -> boolReturns true if the Value is a Null. Returns false otherwise.
For any Value on which is_null returns true, as_null is guaranteed
to return Some(()).
let v: Value = serde_yaml::from_str("null").unwrap(); assert!(v.is_null());
let v: Value = serde_yaml::from_str("false").unwrap(); assert!(!v.is_null());
pub fn as_null(&self) -> Option<()>[src]
pub fn as_null(&self) -> Option<()>If the Value is a Null, returns (). Returns None otherwise.
let v: Value = serde_yaml::from_str("null").unwrap(); assert_eq!(v.as_null(), Some(()));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_null(), None);
pub fn is_bool(&self) -> bool[src]
pub fn is_bool(&self) -> boolReturns true if the Value is a Boolean. Returns false otherwise.
For any Value on which is_boolean returns true, as_bool is
guaranteed to return the boolean value.
let v: Value = serde_yaml::from_str("true").unwrap(); assert!(v.is_bool());
let v: Value = serde_yaml::from_str("42").unwrap(); assert!(!v.is_bool());
pub fn as_bool(&self) -> Option<bool>[src]
pub fn as_bool(&self) -> Option<bool>If the Value is a Boolean, returns the associated bool. Returns None
otherwise.
let v: Value = serde_yaml::from_str("true").unwrap(); assert_eq!(v.as_bool(), Some(true));
let v: Value = serde_yaml::from_str("42").unwrap(); assert_eq!(v.as_bool(), None);
pub fn is_number(&self) -> bool[src]
pub fn is_number(&self) -> boolReturns true if the Value is a Number. Returns false otherwise.
let v: Value = serde_yaml::from_str("5").unwrap(); assert!(v.is_number());
let v: Value = serde_yaml::from_str("true").unwrap(); assert!(!v.is_number());
pub fn is_i64(&self) -> bool[src]
pub fn is_i64(&self) -> boolReturns true if the Value is an integer between i64::MIN and
i64::MAX.
For any Value on which is_i64 returns true, as_i64 is guaranteed to
return the integer value.
let v: Value = serde_yaml::from_str("1337").unwrap(); assert!(v.is_i64());
let v: Value = serde_yaml::from_str("null").unwrap(); assert!(!v.is_i64());
pub fn as_i64(&self) -> Option<i64>[src]
pub fn as_i64(&self) -> Option<i64>If the Value is an integer, represent it as i64 if possible. Returns
None otherwise.
let v: Value = serde_yaml::from_str("1337").unwrap(); assert_eq!(v.as_i64(), Some(1337));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_i64(), None);
pub fn is_u64(&self) -> bool[src]
pub fn is_u64(&self) -> boolReturns true if the Value is an integer between u64::MIN and
u64::MAX.
For any Value on which is_u64 returns true, as_u64 is guaranteed to
return the integer value.
let v: Value = serde_yaml::from_str("1337").unwrap(); assert!(v.is_u64());
let v: Value = serde_yaml::from_str("null").unwrap(); assert!(!v.is_u64());
pub fn as_u64(&self) -> Option<u64>[src]
pub fn as_u64(&self) -> Option<u64>If the Value is an integer, represent it as i64 if possible. Returns
None otherwise.
let v: Value = serde_yaml::from_str("1337").unwrap(); assert_eq!(v.as_u64(), Some(1337));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_u64(), None);
pub fn is_f64(&self) -> bool[src]
pub fn is_f64(&self) -> boolReturns true if the Value is a number that can be represented by f64.
For any Value on which is_f64 returns true, as_f64 is guaranteed to
return the floating point value.
Currently this function returns true if and only if both is_i64 and
is_u64 return false but this is not a guarantee in the future.
let v: Value = serde_yaml::from_str("256.01").unwrap(); assert!(v.is_f64());
let v: Value = serde_yaml::from_str("true").unwrap(); assert!(!v.is_f64());
pub fn as_f64(&self) -> Option<f64>[src]
pub fn as_f64(&self) -> Option<f64>If the Value is a number, represent it as f64 if possible. Returns
None otherwise.
let v: Value = serde_yaml::from_str("13.37").unwrap(); assert_eq!(v.as_f64(), Some(13.37));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_f64(), None);
pub fn is_string(&self) -> bool[src]
pub fn is_string(&self) -> boolReturns true if the Value is a String. Returns false otherwise.
For any Value on which is_string returns true, as_str is guaranteed
to return the string slice.
let v: Value = serde_yaml::from_str("'lorem ipsum'").unwrap(); assert!(v.is_string());
let v: Value = serde_yaml::from_str("42").unwrap(); assert!(!v.is_string());
pub fn as_str(&self) -> Option<&str>[src]
pub fn as_str(&self) -> Option<&str>If the Value is a String, returns the associated str. Returns None
otherwise.
let v: Value = serde_yaml::from_str("'lorem ipsum'").unwrap(); assert_eq!(v.as_str(), Some("lorem ipsum"));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_str(), None);
pub fn is_sequence(&self) -> bool[src]
pub fn is_sequence(&self) -> boolReturns true if the Value is a sequence. Returns false otherwise.
let v: Value = serde_yaml::from_str("[1, 2, 3]").unwrap(); assert!(v.is_sequence());
let v: Value = serde_yaml::from_str("true").unwrap(); assert!(!v.is_sequence());
pub fn as_sequence(&self) -> Option<&Sequence>[src]
pub fn as_sequence(&self) -> Option<&Sequence>If the Value is a sequence, return a reference to it if possible.
Returns None otherwise.
let v: Value = serde_yaml::from_str("[1, 2]").unwrap(); assert_eq!(v.as_sequence(), Some(&vec![Value::Number(Number::from(1)), Value::Number(Number::from(2))]));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_sequence(), None);
pub fn as_sequence_mut(&mut self) -> Option<&mut Sequence>[src]
pub fn as_sequence_mut(&mut self) -> Option<&mut Sequence>If the Value is a sequence, return a mutable reference to it if
possible. Returns None otherwise.
let mut v: Value = serde_yaml::from_str("[1]").unwrap(); let s = v.as_sequence_mut().unwrap(); s.push(Value::Number(Number::from(2))); assert_eq!(s, &vec![Value::Number(Number::from(1)), Value::Number(Number::from(2))]);
let mut v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_sequence_mut(), None);
pub fn is_mapping(&self) -> bool[src]
pub fn is_mapping(&self) -> boolReturns true if the Value is a mapping. Returns false otherwise.
let v: Value = serde_yaml::from_str("a: 42").unwrap(); assert!(v.is_mapping());
let v: Value = serde_yaml::from_str("true").unwrap(); assert!(!v.is_mapping());
pub fn as_mapping(&self) -> Option<&Mapping>[src]
pub fn as_mapping(&self) -> Option<&Mapping>If the Value is a mapping, return a reference to it if possible.
Returns None otherwise.
let v: Value = serde_yaml::from_str("a: 42").unwrap(); let mut expected = Mapping::new(); expected.insert(Value::String("a".into()),Value::Number(Number::from(42))); assert_eq!(v.as_mapping(), Some(&expected));
let v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_mapping(), None);
pub fn as_mapping_mut(&mut self) -> Option<&mut Mapping>[src]
pub fn as_mapping_mut(&mut self) -> Option<&mut Mapping>If the Value is a mapping, return a reference to it if possible.
Returns None otherwise.
let mut v: Value = serde_yaml::from_str("a: 42").unwrap(); let m = v.as_mapping_mut().unwrap(); m.insert(Value::String("b".into()),Value::Number(Number::from(21))); let mut expected = Mapping::new(); expected.insert(Value::String("a".into()),Value::Number(Number::from(42))); expected.insert(Value::String("b".into()),Value::Number(Number::from(21))); assert_eq!(m, &expected);
let mut v: Value = serde_yaml::from_str("false").unwrap(); assert_eq!(v.as_mapping_mut(), None);
Trait Implementations
impl PartialOrd<Value> for Value[src]
impl PartialOrd<Value> for Valuefn partial_cmp(&self, other: &Value) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Value) -> bool[src]
fn lt(&self, other: &Value) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Value) -> bool[src]
fn le(&self, other: &Value) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Value) -> bool[src]
fn gt(&self, other: &Value) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Value) -> bool[src]
fn ge(&self, other: &Value) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl PartialEq<Value> for Value[src]
impl PartialEq<Value> for Valuefn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<str> for Value[src]
impl PartialEq<str> for Valuefn eq(&self, other: &str) -> bool[src]
fn eq(&self, other: &str) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<&'a str> for Value[src]
impl<'a> PartialEq<&'a str> for Valuefn eq(&self, other: &&str) -> bool[src]
fn eq(&self, other: &&str) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for str[src]
impl PartialEq<Value> for strfn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<Value> for &'a str[src]
impl<'a> PartialEq<Value> for &'a strfn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<String> for Value[src]
impl PartialEq<String> for Valuefn eq(&self, other: &String) -> bool[src]
fn eq(&self, other: &String) -> boolCompare YAML value with String
Examples
assert!(Value::String("lorem".into()) == "lorem".to_string());
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for String[src]
impl PartialEq<Value> for Stringfn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolCompare String with YAML value
Examples
assert!("lorem".to_string() == Value::String("lorem".into()));
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<i8> for Value[src]
impl PartialEq<i8> for Valuefn eq(&self, other: &i8) -> bool[src]
fn eq(&self, other: &i8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for i8[src]
impl PartialEq<Value> for i8fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i8> for &'a Value[src]
impl<'a> PartialEq<i8> for &'a Valuefn eq(&self, other: &i8) -> bool[src]
fn eq(&self, other: &i8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i8> for &'a mut Value[src]
impl<'a> PartialEq<i8> for &'a mut Valuefn eq(&self, other: &i8) -> bool[src]
fn eq(&self, other: &i8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<i16> for Value[src]
impl PartialEq<i16> for Valuefn eq(&self, other: &i16) -> bool[src]
fn eq(&self, other: &i16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for i16[src]
impl PartialEq<Value> for i16fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i16> for &'a Value[src]
impl<'a> PartialEq<i16> for &'a Valuefn eq(&self, other: &i16) -> bool[src]
fn eq(&self, other: &i16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i16> for &'a mut Value[src]
impl<'a> PartialEq<i16> for &'a mut Valuefn eq(&self, other: &i16) -> bool[src]
fn eq(&self, other: &i16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<i32> for Value[src]
impl PartialEq<i32> for Valuefn eq(&self, other: &i32) -> bool[src]
fn eq(&self, other: &i32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for i32[src]
impl PartialEq<Value> for i32fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i32> for &'a Value[src]
impl<'a> PartialEq<i32> for &'a Valuefn eq(&self, other: &i32) -> bool[src]
fn eq(&self, other: &i32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i32> for &'a mut Value[src]
impl<'a> PartialEq<i32> for &'a mut Valuefn eq(&self, other: &i32) -> bool[src]
fn eq(&self, other: &i32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<i64> for Value[src]
impl PartialEq<i64> for Valuefn eq(&self, other: &i64) -> bool[src]
fn eq(&self, other: &i64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for i64[src]
impl PartialEq<Value> for i64fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i64> for &'a Value[src]
impl<'a> PartialEq<i64> for &'a Valuefn eq(&self, other: &i64) -> bool[src]
fn eq(&self, other: &i64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<i64> for &'a mut Value[src]
impl<'a> PartialEq<i64> for &'a mut Valuefn eq(&self, other: &i64) -> bool[src]
fn eq(&self, other: &i64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<isize> for Value[src]
impl PartialEq<isize> for Valuefn eq(&self, other: &isize) -> bool[src]
fn eq(&self, other: &isize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for isize[src]
impl PartialEq<Value> for isizefn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<isize> for &'a Value[src]
impl<'a> PartialEq<isize> for &'a Valuefn eq(&self, other: &isize) -> bool[src]
fn eq(&self, other: &isize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<isize> for &'a mut Value[src]
impl<'a> PartialEq<isize> for &'a mut Valuefn eq(&self, other: &isize) -> bool[src]
fn eq(&self, other: &isize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<u8> for Value[src]
impl PartialEq<u8> for Valuefn eq(&self, other: &u8) -> bool[src]
fn eq(&self, other: &u8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for u8[src]
impl PartialEq<Value> for u8fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u8> for &'a Value[src]
impl<'a> PartialEq<u8> for &'a Valuefn eq(&self, other: &u8) -> bool[src]
fn eq(&self, other: &u8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u8> for &'a mut Value[src]
impl<'a> PartialEq<u8> for &'a mut Valuefn eq(&self, other: &u8) -> bool[src]
fn eq(&self, other: &u8) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<u16> for Value[src]
impl PartialEq<u16> for Valuefn eq(&self, other: &u16) -> bool[src]
fn eq(&self, other: &u16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for u16[src]
impl PartialEq<Value> for u16fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u16> for &'a Value[src]
impl<'a> PartialEq<u16> for &'a Valuefn eq(&self, other: &u16) -> bool[src]
fn eq(&self, other: &u16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u16> for &'a mut Value[src]
impl<'a> PartialEq<u16> for &'a mut Valuefn eq(&self, other: &u16) -> bool[src]
fn eq(&self, other: &u16) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<u32> for Value[src]
impl PartialEq<u32> for Valuefn eq(&self, other: &u32) -> bool[src]
fn eq(&self, other: &u32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for u32[src]
impl PartialEq<Value> for u32fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u32> for &'a Value[src]
impl<'a> PartialEq<u32> for &'a Valuefn eq(&self, other: &u32) -> bool[src]
fn eq(&self, other: &u32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<u32> for &'a mut Value[src]
impl<'a> PartialEq<u32> for &'a mut Valuefn eq(&self, other: &u32) -> bool[src]
fn eq(&self, other: &u32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<usize> for Value[src]
impl PartialEq<usize> for Valuefn eq(&self, other: &usize) -> bool[src]
fn eq(&self, other: &usize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for usize[src]
impl PartialEq<Value> for usizefn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<usize> for &'a Value[src]
impl<'a> PartialEq<usize> for &'a Valuefn eq(&self, other: &usize) -> bool[src]
fn eq(&self, other: &usize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<usize> for &'a mut Value[src]
impl<'a> PartialEq<usize> for &'a mut Valuefn eq(&self, other: &usize) -> bool[src]
fn eq(&self, other: &usize) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<f32> for Value[src]
impl PartialEq<f32> for Valuefn eq(&self, other: &f32) -> bool[src]
fn eq(&self, other: &f32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for f32[src]
impl PartialEq<Value> for f32fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<f32> for &'a Value[src]
impl<'a> PartialEq<f32> for &'a Valuefn eq(&self, other: &f32) -> bool[src]
fn eq(&self, other: &f32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<f32> for &'a mut Value[src]
impl<'a> PartialEq<f32> for &'a mut Valuefn eq(&self, other: &f32) -> bool[src]
fn eq(&self, other: &f32) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<f64> for Value[src]
impl PartialEq<f64> for Valuefn eq(&self, other: &f64) -> bool[src]
fn eq(&self, other: &f64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl PartialEq<Value> for f64[src]
impl PartialEq<Value> for f64fn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<f64> for &'a Value[src]
impl<'a> PartialEq<f64> for &'a Valuefn eq(&self, other: &f64) -> bool[src]
fn eq(&self, other: &f64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<'a> PartialEq<f64> for &'a mut Value[src]
impl<'a> PartialEq<f64> for &'a mut Valuefn eq(&self, other: &f64) -> bool[src]
fn eq(&self, other: &f64) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Clone for Value[src]
impl Clone for Valuefn clone(&self) -> Value[src]
fn clone(&self) -> ValueReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl From<i8> for Value[src]
impl From<i8> for Valueimpl From<i16> for Value[src]
impl From<i16> for Valueimpl From<i32> for Value[src]
impl From<i32> for Valueimpl From<i64> for Value[src]
impl From<i64> for Valueimpl From<isize> for Value[src]
impl From<isize> for Valueimpl From<u8> for Value[src]
impl From<u8> for Valueimpl From<u16> for Value[src]
impl From<u16> for Valueimpl From<u32> for Value[src]
impl From<u32> for Valueimpl From<u64> for Value[src]
impl From<u64> for Valueimpl From<usize> for Value[src]
impl From<usize> for Valueimpl From<f32> for Value[src]
impl From<f32> for Valueimpl From<f64> for Value[src]
impl From<f64> for Valueimpl From<bool> for Value[src]
impl From<bool> for Valueimpl From<String> for Value[src]
impl From<String> for Valuefn from(f: String) -> Self[src]
fn from(f: String) -> SelfConvert String to Value
Examples
use serde_yaml::Value; let s: String = "lorem".to_string(); let x: Value = s.into();
impl<'a> From<&'a str> for Value[src]
impl<'a> From<&'a str> for Valuefn from(f: &str) -> Self[src]
fn from(f: &str) -> SelfConvert string slice to Value
Examples
use serde_yaml::Value; let s: &str = "lorem"; let x: Value = s.into();
impl<'a> From<Cow<'a, str>> for Value[src]
impl<'a> From<Cow<'a, str>> for Valuefn from(f: Cow<'a, str>) -> Self[src]
fn from(f: Cow<'a, str>) -> SelfConvert copy-on-write string to Value
Examples
use serde_yaml::Value; use std::borrow::Cow; let s: Cow<str> = Cow::Borrowed("lorem"); let x: Value = s.into();
use serde_yaml::Value; use std::borrow::Cow; let s: Cow<str> = Cow::Owned("lorem".to_string()); let x: Value = s.into();
impl From<Mapping> for Value[src]
impl From<Mapping> for Valuefn from(f: Mapping) -> Self[src]
fn from(f: Mapping) -> SelfConvert map (with string keys) to Value
Examples
use serde_yaml::{Mapping, Value}; let mut m = Mapping::new(); m.insert("Lorem".into(), "ipsum".into()); let x: Value = m.into();
impl<T: Into<Value>> From<Vec<T>> for Value[src]
impl<T: Into<Value>> From<Vec<T>> for Valuefn from(f: Vec<T>) -> Self[src]
fn from(f: Vec<T>) -> SelfConvert a Vec to Value
Examples
use serde_yaml::Value; let v = vec!["lorem", "ipsum", "dolor"]; let x: Value = v.into();
impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value[src]
impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Valuefn from(f: &'a [T]) -> Self[src]
fn from(f: &'a [T]) -> SelfConvert a slice to Value
Examples
use serde_yaml::Value; let v: &[&str] = &["lorem", "ipsum", "dolor"]; let x: Value = v.into();
impl Eq for Value[src]
impl Eq for Valueimpl Debug for Value[src]
impl Debug for Valuefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a> Index<&'a Value> for Mapping[src]
impl<'a> Index<&'a Value> for Mappingtype Output = Value
The returned type after indexing.
fn index(&self, index: &'a Value) -> &Value[src]
fn index(&self, index: &'a Value) -> &ValuePerforms the indexing (container[index]) operation.
impl<I> Index<I> for Value where
I: Index, [src]
impl<I> Index<I> for Value where
I: Index, type Output = Value
The returned type after indexing.
fn index(&self, index: I) -> &Value[src]
fn index(&self, index: I) -> &ValueIndex into a serde_yaml::Value using the syntax value[0] or
value["k"].
Returns Value::Null if the type of self does not match the type of
the index, for example if the index is a string and self is a sequence
or a number. Also returns Value::Null if the given key does not exist
in the map or the given index is not within the bounds of the sequence.
For retrieving deeply nested values, you should have a look at the
Value::pointer method.
Examples
let data = yaml(r#"{ x: { y: [z, zz] } }"#); assert_eq!(data["x"]["y"], yaml(r#"["z", "zz"]"#)); assert_eq!(data["x"]["y"][0], yaml(r#""z""#)); assert_eq!(data["a"], yaml(r#"null"#)); // returns null for undefined values assert_eq!(data["a"]["b"], yaml(r#"null"#)); // does not panic
impl<'a> IndexMut<&'a Value> for Mapping[src]
impl<'a> IndexMut<&'a Value> for Mappingfn index_mut(&mut self, index: &'a Value) -> &mut Value[src]
fn index_mut(&mut self, index: &'a Value) -> &mut ValuePerforms the mutable indexing (container[index]) operation.
impl<I> IndexMut<I> for Value where
I: Index, [src]
impl<I> IndexMut<I> for Value where
I: Index, fn index_mut(&mut self, index: I) -> &mut Value[src]
fn index_mut(&mut self, index: I) -> &mut ValueWrite into a serde_yaml::Value using the syntax value[0] = ... or
value["k"] = ....
If the index is a number, the value must be a sequence of length bigger than the index. Indexing into a value that is not a sequence or a sequence that is too small will panic.
If the index is a string, the value must be an object or null which is treated like an empty object. If the key is not already present in the object, it will be inserted with a value of null. Indexing into a value that is neither an object nor null will panic.
Examples
let mut data = yaml(r#"{x: 0}"#); // replace an existing key data["x"] = yaml(r#"1"#); // insert a new key data["y"] = yaml(r#"[false, false, false]"#); // replace a value in a sequence data["y"][0] = yaml(r#"true"#); // inserted a deeply nested key data["a"]["b"]["c"]["d"] = yaml(r#"true"#); println!("{:?}", data);
impl Hash for Value[src]
impl Hash for Valuefn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<T: Into<Value>> FromIterator<T> for Value[src]
impl<T: Into<Value>> FromIterator<T> for Valuefn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> SelfConvert an iteratable type to a YAML sequence
Examples
use serde_yaml::Value; let v = std::iter::repeat(42).take(5); let x: Value = v.collect();
use serde_yaml::Value; let v: Vec<_> = vec!["lorem", "ipsum", "dolor"]; let x: Value = v.into_iter().collect();
use std::iter::FromIterator; use serde_yaml::Value; let x: Value = Value::from_iter(vec!["lorem", "ipsum", "dolor"]);
impl Serialize for Value[src]
impl Serialize for Valuefn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer, [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<'de> Deserializer<'de> for Value[src]
impl<'de> Deserializer<'de> for Valuetype Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a bool value.
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an i8 value.
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an i16 value.
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an i32 value.
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an i64 value.
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a u8 value.
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a u16 value.
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a u32 value.
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a u64 value.
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a f32 value.
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a f64 value.
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a char value.
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, 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, Error> where
V: Visitor<'de>, [src]
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, 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_bytes<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, 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, Error> where
V: Visitor<'de>, [src]
fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, 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_option<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an optional value. Read more
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a unit value.
fn deserialize_unit_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_unit_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a unit struct with a particular name. Read more
fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a sequence of values.
fn deserialize_tuple<V>(
self,
_len: usize,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_tuple<V>(
self,
_len: usize,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, 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_tuple_struct<V>(
self,
_name: &'static str,
_len: usize,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_tuple_struct<V>(
self,
_name: &'static str,
_len: usize,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a map of key-value pairs.
fn deserialize_struct<V>(
self,
_name: &'static str,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_struct<V>(
self,
_name: &'static str,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more
fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, [src]
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>, Hint that the Deserialize type needs to deserialize a value whose type doesn't matter because it is ignored. Read more
fn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>, [src]
fn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an i128 value. Read more
fn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>, [src]
fn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>, Hint that the Deserialize type is expecting an u128 value. Read more
fn is_human_readable(&self) -> bool[src]
fn is_human_readable(&self) -> boolDetermine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
impl<'de> Deserialize<'de> for Value[src]
impl<'de> Deserialize<'de> for Valuefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,