Struct polyvalue::Value

source ·
pub struct Value { /* private fields */ }
Expand description

Main value type This is an enum that can hold any of the supported value types

Implementations§

source§

impl Value

source

pub fn new(inner: InnerValue) -> Self

Creates a new value from the given inner value

source

pub fn into_inner(self) -> InnerValue

Consumes the value and returns the inner value

source

pub fn inner(&self) -> &InnerValue

Returns a reference to the inner value

source

pub fn inner_mut(&mut self) -> &mut InnerValue

Returns a mutable reference to the inner value

source

pub fn set_flag(&mut self, flag: u8)

Set a flag on the value

source

pub fn clear_flag(&mut self, flag: u8)

Clears the given flag

source

pub fn has_flag(&self, flag: u8) -> bool

Returns true if the value has the given flag

source

pub fn serialize_tagged(self) -> Result<String, Error>

Serializes the value to a tagged value This is useful for serialization, as it will preserve the type of integers

source

pub fn deserialize_tagged(value: &str) -> Result<Self, Error>

Deserializes a tagged value

source

pub fn bool(inner: impl Into<Bool>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn u8(inner: impl Into<U8>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn i8(inner: impl Into<I8>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn u16(inner: impl Into<U16>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn i16(inner: impl Into<I16>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn u32(inner: impl Into<U32>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn i32(inner: impl Into<I32>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn u64(inner: impl Into<U64>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn i64(inner: impl Into<I64>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn float(inner: impl Into<Float>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn fixed(inner: impl Into<Fixed>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn currency(inner: impl Into<Currency>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn string(inner: impl Into<Str>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn range(inner: impl Into<Range>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn array(inner: impl Into<Array>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn object(inner: impl Into<Object>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn int(inner: impl Into<I64>) -> Self

Creates a new value from the given inner value Use with the types defined in crate::types

source

pub fn resolve(self, other: Self) -> Result<(Value, Value), Error>

Resolves the type of two values based on a priority system. If successful, both returned values are guaranteed to be of the same type

Consumes both values

For details on type resolution, see Value::type_for_comparison

§Example
use polyvalue::Value;
use polyvalue::ValueType;

let a = Value::from(1.0);
let b = Value::from(2);
let (a, b) = a.resolve(b).expect("Could not resolve types");
assert!(a.own_type() == ValueType::Float);
assert!(b.own_type() == ValueType::Float);
source

pub fn own_type(&self) -> ValueType

Returns the type of the value

§Example
use polyvalue::Value;
use polyvalue::ValueType;

let value = Value::from(1.0);
assert!(value.own_type() == ValueType::Float);
source

pub fn either_type(&self, other: &Self, match_on: ValueType) -> bool

returns true if either value is of the given type

§Example
use polyvalue::Value;
use polyvalue::ValueType;

let a = Value::from(1.0);
let b = Value::from(2);
assert!(a.either_type(&b, ValueType::Float));
source

pub fn as_a<T>(self) -> Result<T, Error>
where Self: TryInto<T, Error = Error>,

Resolves a value to the given type Use with the types defined in crate::types

Useful for enforcing a specific type, when you still wish to allow type-cooersion Float to Int, for example

§Example
use polyvalue::Value;
use polyvalue::types::I64;

let value = Value::from(1.0);
let int = value.as_a::<I64>().expect("Value could not be converted to int!");
source

pub fn if_is_a<T>(&self, type_name: ValueType) -> Option<T>
where Self: TryInto<T, Error = Error>,

Resolves a value to the given type, if the type matches a condition Use with the types defined in crate::types Returns None if the type does not match

§Example
use polyvalue::{ValueType, Value};

let value = Value::from(1.0);
if let Some(value) = value.if_is_a::<i64>(ValueType::Numeric) {
   println!("Value is a number: {}", value);
}
source

pub fn is_a(&self, type_name: ValueType) -> bool

Returns true if the value is of the given type Use with the ValueType enum

§Example
use polyvalue::Value;
use polyvalue::ValueType;

let value = Value::from(1.0);
assert!(!value.is_a(ValueType::Int));
source

pub fn as_type(self, type_name: ValueType) -> Result<Value, Error>

Resolves a value to the given type Will fail if the value cannot be converted to the given type,

For virtual types, the highest-priority match will be used For any, the input value will be returned For numeric, the value will be converted to fixed For collection, the value will be converted to object

Similar to Value::as_a, but for type names in the ValueType enum intead of types in the crate::types module

§Example
use polyvalue::Value;
use polyvalue::ValueType;

let value = Value::from(1.0);
let int = value.as_type(ValueType::Int).expect("Value could not be converted to int!");
source

pub fn type_for_comparison(&self, other: &Self) -> ValueType

Resolves the type of two values based on a priority system in order to determine how 2 values should be compared

The priority system is designed to prevent loss of information when comparing values of different types For example, Object -> Array would lose information on non-numeric keys Wheres Array -> Object would not

If both values are the same type, return that type Otherwise, cooerce both values to the same type using the order of priority:

  • Object
  • Array
  • String
  • Currency
  • Fixed
  • Float
  • Int
  • Bool
source

pub fn is_truthy(&self) -> bool

Returns true if the value is truthy This is a convenience method for boolean values

source

pub fn len(&self) -> usize

Returns the length of the value For strings, this is the length of the string in characters For collection types, this is the number of elements For everything else, this is 1 (the length of the array it would resolve to)

source

pub fn to_json_string(&self) -> String

Returns the value as a JSON string Returned value should be valid JSON

source

pub fn weak_equality(self, other: Self) -> Result<bool, Error>

Compares two values, ignoring type Consumes both values

source

pub fn weak_ord(self, other: Self) -> Result<Ordering, Error>

Compares two values, ignoring type Consumes both values

Trait Implementations§

source§

impl ArithmeticOperationExt for Value

source§

fn arithmetic_op( self, right: Self, operation: ArithmeticOperation ) -> Result<Self, Error>

Perform an arithmetic operation on two values If the operation is not supported on the given type, an Error::UnsupportedOperation will be returned Read more
source§

fn arithmetic_neg(self) -> Result<Self, Error>
where Self: Sized,

Perform an arithmetic negation on a value This is equivalent to arithmetic_op with ArithmeticOperation::Negate but is provided for convenience Read more
source§

impl BitwiseOperationExt for Value

source§

fn bitwise_op( self, right: Self, operation: BitwiseOperation ) -> Result<Self, Error>

Perform a bitwise operation on two values If the operation is not supported on the given type, an Error::UnsupportedOperation will be returned Read more
source§

fn bitwise_not(self) -> Result<Self, Error>
where Self: Sized,

Perform a bitwise not on a value This is equivalent to bitwise_op with BitwiseOperation::Not but is provided for convenience Read more
source§

impl BooleanOperationExt for Value

source§

fn boolean_op( self, right: Self, operation: BooleanOperation ) -> Result<Self, Error>

Perform a boolean operation on two values If the operation is not supported on the given type, an Error::UnsupportedOperation will be returned Read more
source§

fn boolean_not(self) -> Result<Value, Error>
where Self: Sized,

Perform a boolean not on a value This is equivalent to boolean_op with BooleanOperation::Not but is provided for convenience Read more
source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy 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<'de> Deserialize<'de> for Value

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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 From<&str> for Value

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<Array> for Value

source§

fn from(v: Array) -> Self

Converts to this type from the input type.
source§

impl From<Bool> for Value

source§

fn from(value: Bool) -> Self

Converts to this type from the input type.
source§

impl From<Currency> for Value

source§

fn from(v: Currency) -> Self

Converts to this type from the input type.
source§

impl From<CurrencyInner> for Value

source§

fn from(value: CurrencyInner) -> Self

Converts to this type from the input type.
source§

impl From<Fixed> for Value

source§

fn from(v: Fixed) -> Self

Converts to this type from the input type.
source§

impl From<Float> for Value

source§

fn from(v: Float) -> Self

Converts to this type from the input type.
source§

impl From<I16> for Value

source§

fn from(v: I16) -> Self

Converts to this type from the input type.
source§

impl From<I32> for Value

source§

fn from(v: I32) -> Self

Converts to this type from the input type.
source§

impl From<I64> for Value

source§

fn from(v: I64) -> Self

Converts to this type from the input type.
source§

impl From<I8> for Value

source§

fn from(v: I8) -> Self

Converts to this type from the input type.
source§

impl From<InnerValue> for Value

source§

fn from(inner: InnerValue) -> Value

Converts to this type from the input type.
source§

impl From<Object> for Value

source§

fn from(v: Object) -> Self

Converts to this type from the input type.
source§

impl From<ObjectInner> for Value

source§

fn from(value: ObjectInner) -> Self

Converts to this type from the input type.
source§

impl From<Range> for Value

source§

fn from(v: Range) -> Self

Converts to this type from the input type.
source§

impl From<RangeInclusive<<I64 as ValueTrait>::Inner>> for Value

source§

fn from(value: RangeInner) -> Self

Converts to this type from the input type.
source§

impl From<Str> for Value

source§

fn from(v: Str) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl From<U16> for Value

source§

fn from(v: U16) -> Self

Converts to this type from the input type.
source§

impl From<U32> for Value

source§

fn from(v: U32) -> Self

Converts to this type from the input type.
source§

impl From<U64> for Value

source§

fn from(v: U64) -> Self

Converts to this type from the input type.
source§

impl From<U8> for Value

source§

fn from(v: U8) -> Self

Converts to this type from the input type.
source§

impl From<Value> for Bool

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl From<Value> for InnerValue

source§

fn from(value: Value) -> InnerValue

Converts to this type from the input type.
source§

impl<V> From<Vec<V>> for Value
where Value: From<V>,

source§

fn from(v: Vec<V>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(value: FloatInner) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(value: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Value

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for Value

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IndexingMutationExt for Value

source§

fn get_index_mut(&mut self, index: &Value) -> Result<&mut Value, Error>

Get a value from an index Returns a mutable reference to the value, or an Error::Index if the index is not found Read more
source§

fn get_indices_mut(&mut self, index: &Value) -> Result<Vec<&mut Value>, Error>

Get values from one or more indices, mutably Returns a vector of references to the values, or an Error::Index if any of the indices are not found Read more
source§

fn set_index(&mut self, index: &Value, value: Value) -> Result<(), Error>

Set a value at an index Returns an Error::Index if the index is not found Read more
source§

fn insert_at(&mut self, index: &Value, value: Value) -> Result<(), Error>

Insert a value at an index Returns an Error::Index if the index is out of bounds Read more
source§

fn delete_index(&mut self, index: &Value) -> Result<Value, Error>

Delete a value at an index Returns an Error::Index if the index is not found Read more
source§

impl IndexingOperationExt for Value

source§

fn get_index(&self, index: &Value) -> Result<Value, Error>

Get a value from an index Returns a value, or an Error::Index if the index is not found Read more
source§

fn get_indices(&self, index: &Value) -> Result<Value, Error>

Get values from one or more indices Returns a vector of values, or an Error::Index if any of the indices are not found Read more
source§

impl MatchingOperationExt for Value

source§

fn matching_op( container: &Self, pattern: &Value, operation: MatchingOperation ) -> Result<Value, Error>
where Self: Sized,

Perform a matching operation on two values If the operation is not supported on the given type, an Error::UnsupportedOperation will be returned Read more
source§

impl Ord for Value

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Value

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Value

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Value

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<Value> for Array

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Currency

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Fixed

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Float

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for I16

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for I32

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for I64

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for I8

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Object

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Range

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Str

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for U16

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for U32

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for U64

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for U8

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryFrom<Value> for Value

§

type Error = 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<KV, VV> TryFrom<Vec<(KV, VV)>> for Value
where Value: From<KV> + From<VV>,

§

type Error = Error

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

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

Performs the conversion.
source§

impl TryInto<CurrencyInner> for Value

§

type Error = Error

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

fn try_into(self) -> Result<CurrencyInner, Self::Error>

Performs the conversion.
source§

impl TryInto<ObjectInner> for Value

§

type Error = Error

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

fn try_into(self) -> Result<ObjectInner, Self::Error>

Performs the conversion.
source§

impl TryInto<RangeInclusive<<I64 as ValueTrait>::Inner>> for Value

§

type Error = Error

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

fn try_into(self) -> Result<RangeInner, Self::Error>

Performs the conversion.
source§

impl TryInto<String> for Value

§

type Error = Error

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

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
source§

impl TryInto<Vec<Value>> for Value

§

type Error = Error

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

fn try_into(self) -> Result<ArrayInner, Self::Error>

Performs the conversion.
source§

impl TryInto<bool> for Value

§

type Error = Error

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

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
source§

impl TryInto<f64> for Value

§

type Error = Error

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

fn try_into(self) -> Result<FloatInner, Self::Error>

Performs the conversion.
source§

impl TryInto<i16> for Value

§

type Error = Error

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

fn try_into(self) -> Result<i16, Self::Error>

Performs the conversion.
source§

impl TryInto<i32> for Value

§

type Error = Error

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

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
source§

impl TryInto<i64> for Value

§

type Error = Error

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

fn try_into(self) -> Result<i64, Self::Error>

Performs the conversion.
source§

impl TryInto<i8> for Value

§

type Error = Error

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

fn try_into(self) -> Result<i8, Self::Error>

Performs the conversion.
source§

impl TryInto<u16> for Value

§

type Error = Error

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

fn try_into(self) -> Result<u16, Self::Error>

Performs the conversion.
source§

impl TryInto<u32> for Value

§

type Error = Error

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

fn try_into(self) -> Result<u32, Self::Error>

Performs the conversion.
source§

impl TryInto<u64> for Value

§

type Error = Error

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

fn try_into(self) -> Result<u64, Self::Error>

Performs the conversion.
source§

impl TryInto<u8> for Value

§

type Error = Error

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

fn try_into(self) -> Result<u8, Self::Error>

Performs the conversion.
source§

impl Eq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

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> 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,

§

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§

default 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>,

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,