Enum Value

Source
pub enum Value {
    Null,
    Bool(bool),
    Number(u64, i16, bool),
    String(String),
    Array(Vec<Value>),
    Object(HashMap<String, Value>),
}
Expand description

Type to store any JSON node.

Numbers are represented by 3 parts: mantissa, exponent, sign.

Many built-in types can be converted to Value.

use nop_json::Value;
use std::convert::TryInto;

let v0: Value = 3u32.try_into().unwrap();
let v1: Value = vec![true, false, true].try_into().unwrap();
assert_eq!(v0, Value::Number(3, 0, false));
assert_eq!(v1, Value::Array(vec![Value::Bool(true), Value::Bool(false), Value::Bool(true)]));

And the Value can be converted to many types.

use nop_json::Value;
use std::convert::TryInto;

let v0: u32 = Value::Number(3, 0, false).try_into().unwrap();
let v1: Vec<bool> = Value::Array(vec![Value::Bool(true), Value::Bool(false), Value::Bool(true)]).try_into().unwrap();
assert_eq!(v0, 3u32);
assert_eq!(v1, vec![true, false, true]);

Variants§

§

Null

§

Bool(bool)

§

Number(u64, i16, bool)

§

String(String)

§

Array(Vec<Value>)

§

Object(HashMap<String, Value>)

Implementations§

Source§

impl Value

Source

pub fn is_null(&self) -> bool

Source

pub fn is_bool(&self) -> bool

Source

pub fn is_number(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_array(&self) -> bool

Source

pub fn is_object(&self) -> bool

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DebugToJson for Value

Source§

fn fmt(&self, out: &mut Formatter<'_>) -> Result

Source§

fn to_json_string(&self) -> String
where Self: Sized,

Any type that implements DebugToJson can be converted to JSON string. For example DebugToJson is implemented for primitive types: Read more
Source§

impl Display for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for Value

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(value: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<'a> Index<&'a str> for Value

Source§

type Output = Value

The returned type after indexing.
Source§

fn index(&self, index: &'a str) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<()> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(_value: ()) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, ()>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, ()>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, String>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, String>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, bool>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, bool>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, char>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, char>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, i16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, i32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, i64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, i8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, isize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, u16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, u32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, u64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, u8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<BTreeMap<String, usize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: BTreeMap<String, usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, ()>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, ()>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, String>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, String>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, Value>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, Value>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, bool>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, bool>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, char>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, char>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, i16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, i32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, i64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, i8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, isize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, u16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, u32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, u64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, u8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<HashMap<String, usize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: HashMap<String, usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<()>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<()>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<String>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<String>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<bool>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<bool>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<char>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<char>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<i16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<i32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<i64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<i8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<isize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<u16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<u32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<u64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<u8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<LinkedList<usize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: LinkedList<usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<String> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: String) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for ()

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for String

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> TryFrom<Value> for Vec<T>
where T: TryFrom<Value>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for bool

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for char

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f64

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i128

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i64

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i8

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for isize

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u128

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u64

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u8

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for usize

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<()>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<()>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<String>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<String>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<Value>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<Value>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<bool>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<bool>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<char>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<char>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<i16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<i32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<i64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<i8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<isize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<usize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<()>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<()>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<String>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<String>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<bool>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<bool>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<char>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<char>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<i16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<i32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<i64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<i8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<isize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<u16>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<u32>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<u64>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<u8>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<VecDeque<usize>> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: VecDeque<usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<bool> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: bool) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<char> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: char) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i16> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i32> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i64> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i8> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<isize> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u16> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u32> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u8> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<usize> for Value

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFromJson for Value

Source§

fn try_from_json<T>(reader: &mut Reader<T>) -> Result<Self>
where T: Iterator<Item = u8>,

Source§

impl<W: Write> WriteToJson<W> for Value

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.