You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being a newcomer to rmp, I needed some struggle to understand that I have to enable the with-serde feature of the rmpv crate for de/serializing data of type rmpv::Value. So far so good, e.g. now I can nicely convert a type into a Value with mpv::ext::to_value().
However, such Values are always created as Value::Arrays during serialization and there seems to be no way influencing this behavior. For serialization, usually there's a pair of functions where the default serializes into an array (e.g. rmp_serde::encode::to_vec) and there's a variant creating a map (e.g. rmp_serde::encode::to_vec_named). I cannot see anything similar for values, there's only to_value() without to_value_named() or anything similar.
Is there any way to serialize a type into a Value::Map with the current codebase? Would this require extra development efforts within the library? I even thought of customizing rmpv::ext::se::Serializer which seems to cause this behavior, but it's even private in the module.
The text was updated successfully, but these errors were encountered:
Being a newcomer to
rmp
, I needed some struggle to understand that I have to enable thewith-serde
feature of thermpv
crate for de/serializing data of typermpv::Value
. So far so good, e.g. now I can nicely convert a type into aValue
withmpv::ext::to_value()
.However, such
Value
s are always created asValue::Array
s during serialization and there seems to be no way influencing this behavior. For serialization, usually there's a pair of functions where the default serializes into an array (e.g.rmp_serde::encode::to_vec
) and there's a variant creating a map (e.g.rmp_serde::encode::to_vec_named
). I cannot see anything similar for values, there's onlyto_value()
withoutto_value_named()
or anything similar.Is there any way to serialize a type into a
Value::Map
with the current codebase? Would this require extra development efforts within the library? I even thought of customizingrmpv::ext::se::Serializer
which seems to cause this behavior, but it's even private in the module.The text was updated successfully, but these errors were encountered: