[
https://issues.apache.org/jira/browse/AVRO-3664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17631010#comment-17631010
]
Martin Tzvetanov Grigorov commented on AVRO-3664:
-------------------------------------------------
Thank you!
It is clear now!
I also quickly tried to implement it but I cannot find a way how to check
whether the type derives serde::Serialize for to_value() and serde::Deserialize
for from_value().
I.e. in the proc macro I need something like an 'if' check that the type
derives Serialize before adding "From<Type> for Value".
> Add Rust Avro Value conversion derive implementations
> -----------------------------------------------------
>
> Key: AVRO-3664
> URL: https://issues.apache.org/jira/browse/AVRO-3664
> Project: Apache Avro
> Issue Type: New Feature
> Components: rust
> Reporter: Aaron Spiegel
> Priority: Major
>
> Given the current constraints of the _AvroSchema_ derive macro, it is
> possible to also derive the following implementations:
> {code:java}
> impl From<apache_avro::types::Value> for X {...}
> impl from<X> for apache_avro::types::Value {...}{code}
> With these traits implemented, serialization in Avro becomes considerably
> simpler, for schemas that are already generated through a derive macro.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)