Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions arrow-array/src/array/boolean_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ impl BooleanArray {
}
}

impl super::private::Sealed for BooleanArray {}

impl Array for BooleanArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/byte_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ impl<T: ByteArrayType> std::fmt::Debug for GenericByteArray<T> {
}
}

impl<T: ByteArrayType> super::private::Sealed for GenericByteArray<T> {}

impl<T: ByteArrayType> Array for GenericByteArray<T> {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/byte_view_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,6 @@ impl<T: ByteViewType + ?Sized> Debug for GenericByteViewArray<T> {
}
}

impl<T: ByteViewType + ?Sized> super::private::Sealed for GenericByteViewArray<T> {}

impl<T: ByteViewType + ?Sized> Array for GenericByteViewArray<T> {
fn as_any(&self) -> &dyn Any {
self
Expand Down
4 changes: 0 additions & 4 deletions arrow-array/src/array/dictionary_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,6 @@ impl<'a, T: ArrowDictionaryKeyType> FromIterator<&'a str> for DictionaryArray<T>
}
}

impl<T: ArrowDictionaryKeyType> super::private::Sealed for DictionaryArray<T> {}

impl<T: ArrowDictionaryKeyType> Array for DictionaryArray<T> {
fn as_any(&self) -> &dyn Any {
self
Expand Down Expand Up @@ -853,8 +851,6 @@ impl<'a, K: ArrowDictionaryKeyType, V> TypedDictionaryArray<'a, K, V> {
}
}

impl<K: ArrowDictionaryKeyType, V: Sync> super::private::Sealed for TypedDictionaryArray<'_, K, V> {}

impl<K: ArrowDictionaryKeyType, V: Sync> Array for TypedDictionaryArray<'_, K, V> {
fn as_any(&self) -> &dyn Any {
self.dictionary
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/fixed_size_binary_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,6 @@ impl std::fmt::Debug for FixedSizeBinaryArray {
}
}

impl super::private::Sealed for FixedSizeBinaryArray {}

impl Array for FixedSizeBinaryArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/fixed_size_list_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ impl From<FixedSizeListArray> for ArrayData {
}
}

impl super::private::Sealed for FixedSizeListArray {}

impl Array for FixedSizeListArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/list_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ impl<OffsetSize: OffsetSizeTrait> GenericListArray<OffsetSize> {
}
}

impl<OffsetSize: OffsetSizeTrait> super::private::Sealed for GenericListArray<OffsetSize> {}

impl<OffsetSize: OffsetSizeTrait> Array for GenericListArray<OffsetSize> {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/list_view_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,6 @@ impl<OffsetSize: OffsetSizeTrait> ArrayAccessor for &GenericListViewArray<Offset
}
}

impl<OffsetSize: OffsetSizeTrait> super::private::Sealed for GenericListViewArray<OffsetSize> {}

impl<OffsetSize: OffsetSizeTrait> Array for GenericListViewArray<OffsetSize> {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/map_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ impl MapArray {
}
}

impl super::private::Sealed for MapArray {}

impl Array for MapArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
14 changes: 1 addition & 13 deletions arrow-array/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,8 @@ pub use list_view_array::*;

use crate::iterator::ArrayIter;

mod private {
/// Private marker trait to ensure [`super::Array`] can not be implemented outside this crate
pub trait Sealed {}

impl<T: Sealed> Sealed for &T {}
}

/// An array in the [arrow columnar format](https://arrow.apache.org/docs/format/Columnar.html)
///
/// This trait is sealed as it is not intended for custom array types, rather only
/// those defined in this crate.
pub trait Array: std::fmt::Debug + Send + Sync + private::Sealed {
pub trait Array: std::fmt::Debug + Send + Sync {
Comment thread
gabotechs marked this conversation as resolved.
Outdated
/// Returns the array as [`Any`] so that it can be
/// downcasted to a specific implementation.
///
Expand Down Expand Up @@ -351,8 +341,6 @@ pub trait Array: std::fmt::Debug + Send + Sync + private::Sealed {
/// A reference-counted reference to a generic `Array`
pub type ArrayRef = Arc<dyn Array>;

impl private::Sealed for ArrayRef {}

/// Ergonomics: Allow use of an ArrayRef as an `&dyn Array`
impl Array for ArrayRef {
fn as_any(&self) -> &dyn Any {
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/null_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ impl NullArray {
}
}

impl super::private::Sealed for NullArray {}

impl Array for NullArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/primitive_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,6 @@ impl<T: ArrowPrimitiveType> From<PrimitiveArray<T>> for ArrayData {
}
}

impl<T: ArrowPrimitiveType> super::private::Sealed for PrimitiveArray<T> {}

impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T> {
fn as_any(&self) -> &dyn Any {
self
Expand Down
4 changes: 0 additions & 4 deletions arrow-array/src/array/run_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ impl<R: RunEndIndexType> From<RunArray<R>> for ArrayData {
}
}

impl<T: RunEndIndexType> super::private::Sealed for RunArray<T> {}

impl<T: RunEndIndexType> Array for RunArray<T> {
fn as_any(&self) -> &dyn Any {
self
Expand Down Expand Up @@ -531,8 +529,6 @@ impl<'a, R: RunEndIndexType, V> TypedRunArray<'a, R, V> {
}
}

impl<R: RunEndIndexType, V: Sync> super::private::Sealed for TypedRunArray<'_, R, V> {}

impl<R: RunEndIndexType, V: Sync> Array for TypedRunArray<'_, R, V> {
fn as_any(&self) -> &dyn Any {
self.run_array
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/struct_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ impl TryFrom<Vec<(&str, ArrayRef)>> for StructArray {
}
}

impl super::private::Sealed for StructArray {}

impl Array for StructArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
2 changes: 0 additions & 2 deletions arrow-array/src/array/union_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,6 @@ impl From<UnionArray> for ArrayData {
}
}

impl super::private::Sealed for UnionArray {}

impl Array for UnionArray {
fn as_any(&self) -> &dyn Any {
self
Expand Down
Loading