Into
is a trait with the single method into
. Into
is implemented for every type that implements From
:
impl<T, U> Into<U> for T
where
U: From<T>,
serde_json::Value
implements many different versions of From
impl From<i8> for Value
impl From<i16> for Value
impl From<i32> for Value
impl From<i64> for Value
impl From<isize> for Value
impl From<u8> for Value
impl From<u16> for Value
impl From<u32> for Value
impl From<u64> for Value
impl From<usize> for Value
impl From<f32> for Value
impl From<f64> for Value
impl From<bool> for Value
impl From<String> for Value
impl<'a> From<&'a str> for Value
impl<'a> From<Cow<'a, str>> for Value
impl From<Map<String, Value>> for Value
impl<T: Into<Value>> From<Vec<T>> for Value
impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value
These two traits are used to provide conversions between types that cannot fail. The traits TryFrom
and TryInto
allow for fallible conversions starting in Rust 1.34.
See also:
An astute reader will have noticed that what I showed above actually allows you to convert to a serde_json::Value
. Technically, the original code converts to a RpcObject
from a Value
. Somewhere in your code there is impl From<serde_json::Value> for RpcObject
, but since that implementation isn't provided, I can't link to any useful documentation for that, but the pattern is the same.