lance_arrow

Trait FixedSizeBinaryArrayExt

Source
pub trait FixedSizeBinaryArrayExt {
    // Required method
    fn try_new_from_values(
        values: &UInt8Array,
        stride: i32,
    ) -> Result<FixedSizeBinaryArray, ArrowError>;
}

Required Methods§

Source

fn try_new_from_values( values: &UInt8Array, stride: i32, ) -> Result<FixedSizeBinaryArray, ArrowError>

Create an FixedSizeBinaryArray from values and stride.

use arrow_array::{UInt8Array, FixedSizeBinaryArray};
use arrow_array::types::UInt8Type;
use lance_arrow::FixedSizeBinaryArrayExt;

let int_values = UInt8Array::from_iter(0..10);
let fixed_size_list_arr = FixedSizeBinaryArray::try_new_from_values(&int_values, 2).unwrap();
assert_eq!(fixed_size_list_arr,
    FixedSizeBinaryArray::from(vec![
        Some(vec![0, 1].as_slice()),
        Some(vec![2, 3].as_slice()),
        Some(vec![4, 5].as_slice()),
        Some(vec![6, 7].as_slice()),
        Some(vec![8, 9].as_slice())
]))

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FixedSizeBinaryArrayExt for FixedSizeBinaryArray

Source§

fn try_new_from_values( values: &UInt8Array, stride: i32, ) -> Result<Self, ArrowError>

Implementors§