To keep serde working, I switched to another approach which is actually much simpler. Instead of using serde(try_from/into) (which I no longer couldn't since there is no try_into) I simply created a SerializedElement type which does define serde encoding and used it in place of a raw Element. This allows the struct that contains it to support serde by simply deriving it. It does introduce some friction by requiring using e.g. val.0 .0 but that's internal (and can be avoided with getters). We should probably use the same approach for Scalars, but we can do that in a separate PR.
Closes #667
To keep serde working, I switched to another approach which is actually much simpler. Instead of using
serde(try_from/into)
(which I no longer couldn't since there is notry_into
) I simply created aSerializedElement
type which does define serde encoding and used it in place of a rawElement
. This allows the struct that contains it to support serde by simply deriving it. It does introduce some friction by requiring using e.g.val.0 .0
but that's internal (and can be avoided with getters). We should probably use the same approach for Scalars, but we can do that in a separate PR.