Where Message is a concrete type, that does not implement serde::Serialize (due to being a remote type).
In the context this is in, I have a &mut dyn Serializer and am expected to return a Result<(), erased::Error> so overall, I feel that this is possible.
Looking under the hood, this is also something that erased_serde does with the MakeSerializer struct. However it is not public.
Due to the license, I could copy that as a quick fix, but maybe there is a gotcha and/or an expected way this is solved?
Actually I can't copy it, because erased_serde::Serialize is sealed. :disappointed:
As the title says, I am trying to call a 'classic'
serde
serialize method:Where
Message
is a concrete type, that does not implementserde::Serialize
(due to being a remote type).In the context this is in, I have a
&mut dyn Serializer
and am expected to return aResult<(), erased::Error>
so overall, I feel that this is possible.Looking under the hood, this is also something that
erased_serde
does with theMakeSerializer
struct. However it is not public.Due to the license, I could copy that as a quick fix, but maybe there is a gotcha and/or an expected way this is solved?Actually I can't copy it, because
erased_serde::Serialize
is sealed. :disappointed: