tustvold commented on code in PR #3149:
URL: https://github.com/apache/arrow-rs/pull/3149#discussion_r1029202444


##########
arrow-schema/src/field.rs:
##########
@@ -459,6 +459,21 @@ impl Field {
             }
         }
     }
+
+    /// Return size of this instance in bytes.
+    ///
+    /// Includes the size of `Self`.
+    pub fn size(&self) -> usize {
+        std::mem::size_of_val(self) - std::mem::size_of_val(&self.data_type)
+            + self.data_type.size()
+            + self.name.capacity()
+            + (std::mem::size_of::<(String, String)>() * 
self.metadata.capacity())

Review Comment:
   I'm not sure how accurate this approximation is, but I imagine probably good 
enough to a first order



-- 
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]

Reply via email to