AdamGS commented on code in PR #8558:
URL: https://github.com/apache/arrow-rs/pull/8558#discussion_r2405697896
##########
arrow-schema/src/extension/canonical/fixed_shape_tensor.rs:
##########
@@ -141,6 +144,144 @@ pub struct FixedShapeTensorMetadata {
permutations: Option<Vec<usize>>,
}
+impl Serialize for FixedShapeTensorMetadata {
+ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+ where
+ S: Serializer,
+ {
+ let mut state =
serializer.serialize_struct("FixedShapeTensorMetadata", 3)?;
+ state.serialize_field("shape", &self.shape)?;
+ state.serialize_field("dim_names", &self.dim_names)?;
+ state.serialize_field("permutations", &self.permutations)?;
+ state.end()
+ }
+}
+
+impl<'de> Deserialize<'de> for FixedShapeTensorMetadata {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: Deserializer<'de>,
+ {
+ #[derive(Debug)]
Review Comment:
Definitely autogenerated-inspired, I'll pull all the inner definition
outside.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]