You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/11 13:02:18 UTC

[GitHub] [arrow-rs] alamb opened a new issue #1028: Consider sealing `ArrowNativeType`

alamb opened a new issue #1028:
URL: https://github.com/apache/arrow-rs/issues/1028


   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   
   The comments for `Buffer::typed_data` make the following point
   ```
       /// `ArrowNativeType` is public so that it can be used as a trait bound for other public
       /// components, such as the `ToByteSlice` trait.  However, this means that it can be
       /// implemented by user defined types, which it is not intended for.
   ```
   
   Meaning that if some user crate implements ArrowNativeType for another type, using `Buffer::typed_data` (and others) will result in undefined behavior.
   
   **Describe the solution you'd like**
   Ensure users of the `arrow` crate can not `impl ArrowNativeType` 
   
   One way to do this would be to follow the `sealed trait` pattern here: https://rust-lang.github.io/api-guidelines/future-proofing.html
   
   **Additional context**
   This is extracted  from a discussion with @jhorstmann on https://github.com/apache/arrow-rs/issues/996#issuecomment-986042173 
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org