alamb commented on code in PR #9092:
URL: https://github.com/apache/arrow-rs/pull/9092#discussion_r2658865711
##########
arrow-array/src/array/mod.rs:
##########
@@ -78,8 +78,14 @@ pub use list_view_array::*;
use crate::iterator::ArrayIter;
+mod private {
+ pub trait Sealed {}
Review Comment:
```rust
```suggestion
/// Private marker trait to ensure [`Array`] can not be implemented
outside this crate
pub trait Sealed {}
```
##########
arrow-array/src/array/mod.rs:
##########
@@ -78,8 +78,14 @@ pub use list_view_array::*;
use crate::iterator::ArrayIter;
+mod private {
+ pub trait Sealed {}
+
+ impl<T: Sealed> Sealed for &T {}
+}
+
/// An array in the [arrow columnar
format](https://arrow.apache.org/docs/format/Columnar.html)
-pub trait Array: std::fmt::Debug + Send + Sync {
+pub trait Array: std::fmt::Debug + Send + Sync + private::Sealed {
Review Comment:
```suggestion
///
/// This trait provides access to common properties for all
/// Arrow Arrays.
///
/// As there are no legitimate use case for implementing custom Array
/// types outside the spec and thus is sealed to prevent doing so.
pub trait Array: std::fmt::Debug + Send + Sync + private::Sealed {
```
##########
arrow-array/src/array/mod.rs:
##########
@@ -78,8 +78,14 @@ pub use list_view_array::*;
use crate::iterator::ArrayIter;
+mod private {
+ pub trait Sealed {}
Review Comment:
```rust
```suggestion
/// Private marker trait to ensure [`Array`] can not be implemented
outside this crate
pub trait Sealed {}
```
--
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]