Enum saltpig::value::Value [−][src]
pub enum Value { PosInt(u64), NegInt(u64), Bytes(Vec<u8>), Text(String), Array(Vec<Value>), Map(BTreeMap<OrdValue<'static>, Value>), Tagged(u64, Box<Value>), Float(f64), Bool(bool), Null, Undefined, UnknownSimple(UnknownSimple), }
The generic CBOR type.
Each instance of Value
represents a single CBOR data item. See the CBOR
standard for more information on the CBOR data model (in particular, see
section 2.1 for information on major types, and section 2.3 for
information on simple values).
Value
s are usually created by using From
or Into
to convert from
another Rust type. For ease of use, standard conversions are implemented
from and to all the types that Value
contains (and then some) as well as
all the extension types.
(Value
is generic in the sense that it represents any CBOR value (as
opposed to extension types, which represent specific kinds of CBOR
values), not in the sense that it has type parameters (which it doesn't).)
Comparisons
Value
implements PartialEq
for every type it can be converted from.
It does not, however, implement PartialOrd
: this was thought to be more
trouble than it was worth, since many values would compare inequal without
being greater than or less than. Users needing to compare Value
s with
other types must first convert the Value
to the other type, which forces
them to explicitly consider the case where the Value
was not, in fact,
the desired type. Additionally, Value
will never implement Eq
or
Ord
, because it cannot know the equality and ordering semantics of all
possible tags. However, it is expected that many extension types will
implement Ord
.
The type chosen for CBOR maps, BTreeMap
, requires that its key type
implement Ord
. To enable this, a wrapper type OrdValue
was created.
OrdValue
wraps an owned or borrowed Value
and provides an Ord
impl,
with the caveat that it ignores the actual semantics of the values and
instead simply compares their bytewise encodings. See OrdValue
's
documentation for more information.
Variants
PosInt(u64)
A non-negative integer (major type 0). PosInt(n)
represents the
integer n
.
NegInt(u64)
A negative integer (major type 1). NegInt(n)
represents the integer
-n - 1
.
Bytes(Vec<u8>)
A byte string (major type 2).
Text(String)
A text string (major type 3).
Array(Vec<Value>)
An array (major type 4).
Map(BTreeMap<OrdValue<'static>, Value>)
A map (major type 5).
Tagged(u64, Box<Value>)
A tagged value (major type 6).
Float(f64)
A float (major type 7, additional information 25, 26, or 27).
Bool(bool)
A boolean (simple value 20 or 21).
Null
Null (simple value 22).
Undefined
Undefined (simple value 23).
UnknownSimple(UnknownSimple)
A simple value not covered by the other variants.
Methods
impl Value
[src]
impl Value
pub fn struct_eq(&self, other: &Value) -> bool
[src]
pub fn struct_eq(&self, other: &Value) -> bool
Compares self
with another Value
for structural equality.
struct_eq()
is, roughly, what #[derive(PartialEq)]
would come up
with. It checks whether the Value
s are "the same thing".
More formally, two Value
s are structurally equal if and only if they
have the same variant and contents (using structural equality to compare
any nested Value
s). Notably, every NaN is considered structurally
equal to every other NaN.
More specifically:
- Two
Value
s with different types are never structurally equal. - Two arrays are structurally equal if and only if they have the same values in the same order.
- Two maps are structurally equal if and only if they have the same set set of key-value pairs.
- Two tagged values are structurally equal if and only if they have the same tag and their inner values are structurally equal.
impl Value
[src]
impl Value
pub fn make_array<I, V>(iterable: I) -> Value where
I: IntoIterator<Item = V>,
V: Into<Value>,
[src]
pub fn make_array<I, V>(iterable: I) -> Value where
I: IntoIterator<Item = V>,
V: Into<Value>,
pub fn make_map<I, K, V>(iterable: I) -> Value where
I: IntoIterator<Item = (K, V)>,
K: Into<Value>,
V: Into<Value>,
[src]
pub fn make_map<I, K, V>(iterable: I) -> Value where
I: IntoIterator<Item = (K, V)>,
K: Into<Value>,
V: Into<Value>,
impl Value
[src]
impl Value
pub fn from_reader<R: BufRead>(reader: R) -> Result<Value, Error>
[src]
pub fn from_reader<R: BufRead>(reader: R) -> Result<Value, Error>
Attempts to parse a Value
from a buffered reader.
pub fn from_bytes(bytes: &[u8]) -> Result<Value, Error>
[src]
pub fn from_bytes(bytes: &[u8]) -> Result<Value, Error>
Attempts to parse a Value
from a slice of bytes.
pub fn to_bytes(&self) -> Vec<u8>
[src]
pub fn to_bytes(&self) -> Vec<u8>
Encodes self
into a new Vec<u8>
.
pub fn encode<W>(&self, writer: &mut W) -> Result<(), Error> where
W: Write,
[src]
pub fn encode<W>(&self, writer: &mut W) -> Result<(), Error> where
W: Write,
Encodes self
into the given writer.
There is no guarantee that this method uses the writer with any measure of efficiency. Thus, you probably want to pass in a buffered writer.
pub fn encode_prefix<'b>(&self, buffer: &'b mut [u8]) -> &'b mut [u8]
[src]
pub fn encode_prefix<'b>(&self, buffer: &'b mut [u8]) -> &'b mut [u8]
Encodes just the prefix of self
into the given buffer.
Encodes the major type, additional info, and any length or tag into
buffer
. More specifically:
- For byte strings, text strings, arrays, and maps: the major type, additional info, and length are encoded (but not the contents)
- For tagged values: the major type, additional info, and tag are encoded (but not the value following the tag).
- For all other values, the entire value is encoded.
Writes at least 1 and at most 9 bytes into buffer
.
Returns the portion of buffer
that was written to.
Panics
Panics if buffer
is not large enough to hold self
's prefix (a buffer
of length 9 is always large enough).
pub fn major(&self) -> Major
[src]
pub fn major(&self) -> Major
Returns self
's major type.
pub fn info(&self) -> u8
[src]
pub fn info(&self) -> u8
Returns self
's additional information value.
(Additional information values are always in the range 0..=31
.)
pub fn major_and_info(&self) -> u8
[src]
pub fn major_and_info(&self) -> u8
Returns self
's encoded major and additional information values.
In other words, returns the first byte of self
's encoding.
Trait Implementations
impl From<EncodedCbor> for Value
[src]
impl From<EncodedCbor> for Value
Renders self
into a generic CBOR value.
Equivalent to EncodedCbor::embed()
.
fn from(encoded_cbor: EncodedCbor) -> Value
[src]
fn from(encoded_cbor: EncodedCbor) -> Value
Performs the conversion.
impl TryFrom<Value> for EncodedCbor
[src]
impl TryFrom<Value> for EncodedCbor
Attempts to parse an EncodedCbor
value out of a Value
.
Equivalent to EncodedCbor::extract()
.
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<EncodedCbor, TypeError>
[src]
fn try_from(value: Value) -> Result<EncodedCbor, TypeError>
try_from
)Performs the conversion.
impl From<Ident> for Value
[src]
impl From<Ident> for Value
Renders self
into a generic CBOR value.
Equivalent to Ident::embed()
.
impl TryFrom<Value> for Ident
[src]
impl TryFrom<Value> for Ident
Attempts to parse an Ident
value out of a Value
.
Equivalent to Ident::extract()
.
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Ident, TypeError>
[src]
fn try_from(value: Value) -> Result<Ident, TypeError>
try_from
)Performs the conversion.
impl PartialEq for Value
[src]
impl PartialEq for Value
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<usize> for Value
[src]
impl PartialEq<usize> for Value
fn eq(&self, other: &usize) -> bool
[src]
fn eq(&self, other: &usize) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<isize> for Value
[src]
impl PartialEq<isize> for Value
fn eq(&self, other: &isize) -> bool
[src]
fn eq(&self, other: &isize) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<[u8]> for Value
[src]
impl PartialEq<[u8]> for Value
fn eq(&self, other: &[u8]) -> bool
[src]
fn eq(&self, other: &[u8]) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<Vec<u8>> for Value
[src]
impl PartialEq<Vec<u8>> for Value
fn eq(&self, other: &Vec<u8>) -> bool
[src]
fn eq(&self, other: &Vec<u8>) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<str> for Value
[src]
impl PartialEq<str> for Value
fn eq(&self, other: &str) -> bool
[src]
fn eq(&self, other: &str) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<String> for Value
[src]
impl PartialEq<String> for Value
fn eq(&self, other: &String) -> bool
[src]
fn eq(&self, other: &String) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<u8> for Value
[src]
impl PartialEq<u8> for Value
fn eq(&self, other: &u8) -> bool
[src]
fn eq(&self, other: &u8) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<i8> for Value
[src]
impl PartialEq<i8> for Value
fn eq(&self, other: &i8) -> bool
[src]
fn eq(&self, other: &i8) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<u16> for Value
[src]
impl PartialEq<u16> for Value
fn eq(&self, other: &u16) -> bool
[src]
fn eq(&self, other: &u16) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<i16> for Value
[src]
impl PartialEq<i16> for Value
fn eq(&self, other: &i16) -> bool
[src]
fn eq(&self, other: &i16) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<u32> for Value
[src]
impl PartialEq<u32> for Value
fn eq(&self, other: &u32) -> bool
[src]
fn eq(&self, other: &u32) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<i32> for Value
[src]
impl PartialEq<i32> for Value
fn eq(&self, other: &i32) -> bool
[src]
fn eq(&self, other: &i32) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<u64> for Value
[src]
impl PartialEq<u64> for Value
fn eq(&self, other: &u64) -> bool
[src]
fn eq(&self, other: &u64) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<i64> for Value
[src]
impl PartialEq<i64> for Value
fn eq(&self, other: &i64) -> bool
[src]
fn eq(&self, other: &i64) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<u128> for Value
[src]
impl PartialEq<u128> for Value
fn eq(&self, other: &u128) -> bool
[src]
fn eq(&self, other: &u128) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<i128> for Value
[src]
impl PartialEq<i128> for Value
fn eq(&self, other: &i128) -> bool
[src]
fn eq(&self, other: &i128) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<bool> for Value
[src]
impl PartialEq<bool> for Value
fn eq(&self, other: &bool) -> bool
[src]
fn eq(&self, other: &bool) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<f16> for Value
[src]
impl PartialEq<f16> for Value
fn eq(&self, other: &f16) -> bool
[src]
fn eq(&self, other: &f16) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<f32> for Value
[src]
impl PartialEq<f32> for Value
fn eq(&self, other: &f32) -> bool
[src]
fn eq(&self, other: &f32) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<f64> for Value
[src]
impl PartialEq<f64> for Value
fn eq(&self, other: &f64) -> bool
[src]
fn eq(&self, other: &f64) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl From<Value> for OrdValue<'static>
[src]
impl From<Value> for OrdValue<'static>
impl<'v> From<&'v Value> for OrdValue<'v>
[src]
impl<'v> From<&'v Value> for OrdValue<'v>
impl<'w> AsRef<Value> for OrdValue<'w>
[src]
impl<'w> AsRef<Value> for OrdValue<'w>
impl<'a, T> From<&'a T> for Value where
T: Into<Value> + Copy,
[src]
impl<'a, T> From<&'a T> for Value where
T: Into<Value> + Copy,
impl<T> From<Option<T>> for Value where
T: Into<Value>,
[src]
impl<T> From<Option<T>> for Value where
T: Into<Value>,
impl From<Value> for Cow<'static, Value>
[src]
impl From<Value> for Cow<'static, Value>
impl<'a> From<&'a Value> for Cow<'a, Value>
[src]
impl<'a> From<&'a Value> for Cow<'a, Value>
impl From<u8> for Value
[src]
impl From<u8> for Value
impl From<u16> for Value
[src]
impl From<u16> for Value
impl From<u32> for Value
[src]
impl From<u32> for Value
impl From<u64> for Value
[src]
impl From<u64> for Value
impl From<Vec<u8>> for Value
[src]
impl From<Vec<u8>> for Value
impl From<String> for Value
[src]
impl From<String> for Value
impl From<Vec<Value>> for Value
[src]
impl From<Vec<Value>> for Value
impl From<BTreeMap<OrdValue<'static>, Value>> for Value
[src]
impl From<BTreeMap<OrdValue<'static>, Value>> for Value
impl From<f16> for Value
[src]
impl From<f16> for Value
impl From<f32> for Value
[src]
impl From<f32> for Value
impl From<f64> for Value
[src]
impl From<f64> for Value
impl From<bool> for Value
[src]
impl From<bool> for Value
impl From<UnknownSimple> for Value
[src]
impl From<UnknownSimple> for Value
fn from(object: UnknownSimple) -> Value
[src]
fn from(object: UnknownSimple) -> Value
Performs the conversion.
impl TryFrom<Value> for Vec<u8>
[src]
impl TryFrom<Value> for Vec<u8>
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Vec<u8>, TypeError>
[src]
fn try_from(value: Value) -> Result<Vec<u8>, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for String
[src]
impl TryFrom<Value> for String
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<String, TypeError>
[src]
fn try_from(value: Value) -> Result<String, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for Vec<Value>
[src]
impl TryFrom<Value> for Vec<Value>
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Vec<Value>, TypeError>
[src]
fn try_from(value: Value) -> Result<Vec<Value>, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for BTreeMap<OrdValue<'static>, Value>
[src]
impl TryFrom<Value> for BTreeMap<OrdValue<'static>, Value>
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(
value: Value
) -> Result<BTreeMap<OrdValue<'static>, Value>, TypeError>
[src]
fn try_from(
value: Value
) -> Result<BTreeMap<OrdValue<'static>, Value>, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for UnknownSimple
[src]
impl TryFrom<Value> for UnknownSimple
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<UnknownSimple, TypeError>
[src]
fn try_from(value: Value) -> Result<UnknownSimple, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for u8
[src]
impl<'v> TryFrom<&'v Value> for u8
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<u8, TypeError>
[src]
fn try_from(value: &Value) -> Result<u8, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for u8
[src]
impl TryFrom<Value> for u8
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<u8, TypeError>
[src]
fn try_from(value: Value) -> Result<u8, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for i8
[src]
impl<'v> TryFrom<&'v Value> for i8
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<i8, TypeError>
[src]
fn try_from(value: &Value) -> Result<i8, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for i8
[src]
impl TryFrom<Value> for i8
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<i8, TypeError>
[src]
fn try_from(value: Value) -> Result<i8, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for u16
[src]
impl<'v> TryFrom<&'v Value> for u16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<u16, TypeError>
[src]
fn try_from(value: &Value) -> Result<u16, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for u16
[src]
impl TryFrom<Value> for u16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<u16, TypeError>
[src]
fn try_from(value: Value) -> Result<u16, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for i16
[src]
impl<'v> TryFrom<&'v Value> for i16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<i16, TypeError>
[src]
fn try_from(value: &Value) -> Result<i16, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for i16
[src]
impl TryFrom<Value> for i16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<i16, TypeError>
[src]
fn try_from(value: Value) -> Result<i16, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for u32
[src]
impl<'v> TryFrom<&'v Value> for u32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<u32, TypeError>
[src]
fn try_from(value: &Value) -> Result<u32, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for u32
[src]
impl TryFrom<Value> for u32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<u32, TypeError>
[src]
fn try_from(value: Value) -> Result<u32, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for i32
[src]
impl<'v> TryFrom<&'v Value> for i32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<i32, TypeError>
[src]
fn try_from(value: &Value) -> Result<i32, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for i32
[src]
impl TryFrom<Value> for i32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<i32, TypeError>
[src]
fn try_from(value: Value) -> Result<i32, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for u64
[src]
impl<'v> TryFrom<&'v Value> for u64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<u64, TypeError>
[src]
fn try_from(value: &Value) -> Result<u64, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for u64
[src]
impl TryFrom<Value> for u64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<u64, TypeError>
[src]
fn try_from(value: Value) -> Result<u64, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for i64
[src]
impl<'v> TryFrom<&'v Value> for i64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<i64, TypeError>
[src]
fn try_from(value: &Value) -> Result<i64, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for i64
[src]
impl TryFrom<Value> for i64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<i64, TypeError>
[src]
fn try_from(value: Value) -> Result<i64, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for u128
[src]
impl<'v> TryFrom<&'v Value> for u128
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<u128, TypeError>
[src]
fn try_from(value: &Value) -> Result<u128, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for u128
[src]
impl TryFrom<Value> for u128
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<u128, TypeError>
[src]
fn try_from(value: Value) -> Result<u128, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for i128
[src]
impl<'v> TryFrom<&'v Value> for i128
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<i128, TypeError>
[src]
fn try_from(value: &Value) -> Result<i128, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for i128
[src]
impl TryFrom<Value> for i128
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<i128, TypeError>
[src]
fn try_from(value: Value) -> Result<i128, TypeError>
try_from
)Performs the conversion.
impl From<i8> for Value
[src]
impl From<i8> for Value
impl From<i16> for Value
[src]
impl From<i16> for Value
impl From<i32> for Value
[src]
impl From<i32> for Value
impl From<i64> for Value
[src]
impl From<i64> for Value
impl TryFrom<u128> for Value
[src]
impl TryFrom<u128> for Value
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(n: u128) -> Result<Value, ()>
[src]
fn try_from(n: u128) -> Result<Value, ()>
try_from
)Performs the conversion.
impl TryFrom<i128> for Value
[src]
impl TryFrom<i128> for Value
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(n: i128) -> Result<Value, ()>
[src]
fn try_from(n: i128) -> Result<Value, ()>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for f16
[src]
impl<'v> TryFrom<&'v Value> for f16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<f16, TypeError>
[src]
fn try_from(value: &Value) -> Result<f16, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for f32
[src]
impl<'v> TryFrom<&'v Value> for f32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<f32, TypeError>
[src]
fn try_from(value: &Value) -> Result<f32, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for f64
[src]
impl<'v> TryFrom<&'v Value> for f64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<f64, TypeError>
[src]
fn try_from(value: &Value) -> Result<f64, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for f16
[src]
impl TryFrom<Value> for f16
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<f16, TypeError>
[src]
fn try_from(value: Value) -> Result<f16, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for f32
[src]
impl TryFrom<Value> for f32
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<f32, TypeError>
[src]
fn try_from(value: Value) -> Result<f32, TypeError>
try_from
)Performs the conversion.
impl TryFrom<Value> for f64
[src]
impl TryFrom<Value> for f64
type Error = TypeError
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<f64, TypeError>
[src]
fn try_from(value: Value) -> Result<f64, TypeError>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for bool
[src]
impl<'v> TryFrom<&'v Value> for bool
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<bool, ()>
[src]
fn try_from(value: &Value) -> Result<bool, ()>
try_from
)Performs the conversion.
impl TryFrom<Value> for bool
[src]
impl TryFrom<Value> for bool
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<bool, ()>
[src]
fn try_from(value: Value) -> Result<bool, ()>
try_from
)Performs the conversion.
impl<'v> TryFrom<&'v Value> for char
[src]
impl<'v> TryFrom<&'v Value> for char
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<char, ()>
[src]
fn try_from(value: &Value) -> Result<char, ()>
try_from
)Performs the conversion.
impl TryFrom<Value> for char
[src]
impl TryFrom<Value> for char
type Error = ()
try_from
)The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<char, ()>
[src]
fn try_from(value: Value) -> Result<char, ()>
try_from
)Performs the conversion.
impl Debug for Value
[src]
impl Debug for Value
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Value
[src]
impl Clone for Value