Skip to main content

TypedArrayRef

Trait TypedArrayRef 

Source
pub trait TypedArrayRef<V: VTable>: AsRef<ArrayRef> + Deref<Target = V::TypedArrayData> {
    // Provided methods
    fn to_owned(&self) -> Array<V> { ... }
    fn slots(&self) -> &[Option<ArrayRef>] { ... }
    fn dtype(&self) -> &DType { ... }
    fn len(&self) -> usize { ... }
    fn is_empty(&self) -> bool { ... }
}
Expand description

Shared bound for helpers that should work over both owned Array<V> and borrowed ArrayView<V>.

Extension traits use this to share typed array logic while still exposing the backing ArrayRef and the encoding-specific VTable::TypedArrayData.

Provided Methods§

Source

fn to_owned(&self) -> Array<V>

Returns an owned Array<V> from the reference.

Source

fn slots(&self) -> &[Option<ArrayRef>]

Returns the child slots of the array.

Source

fn dtype(&self) -> &DType

Returns the logical DType of the array.

Source

fn len(&self) -> usize

Returns the number of rows in the array.

Source

fn is_empty(&self) -> bool

Returns true if the array has no rows.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V: VTable> TypedArrayRef<V> for Array<V>

Source§

impl<V: VTable> TypedArrayRef<V> for ArrayView<'_, V>