pub struct FixedSizeListArray { /* private fields */ }
Expand description

A list array where each element is a fixed-size sequence of values with the same type whose maximum length is represented by a i32.

Example

// Construct a value array
let value_data = ArrayData::builder(DataType::Int32)
    .len(9)
    .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
    .build()
    .unwrap();
let list_data_type = DataType::FixedSizeList(
    Box::new(Field::new("item", DataType::Int32, false)),
    3,
);
let list_data = ArrayData::builder(list_data_type.clone())
    .len(3)
    .add_child_data(value_data.clone())
    .build()
    .unwrap();
let list_array = FixedSizeListArray::from(list_data);
let list0 = list_array.value(0);
let list1 = list_array.value(1);
let list2 = list_array.value(2);

assert_eq!( &[0, 1, 2], list0.as_any().downcast_ref::<Int32Array>().unwrap().values());
assert_eq!( &[3, 4, 5], list1.as_any().downcast_ref::<Int32Array>().unwrap().values());
assert_eq!( &[6, 7, 8], list2.as_any().downcast_ref::<Int32Array>().unwrap().values());

For non generic lists, you may wish to consider using crate::array::FixedSizeBinaryArray

Implementations

Returns a reference to the values of this list.

Returns a clone of the value type of this list.

Returns ith value of this list array.

Returns the offset for value at index i.

Note this doesn’t do any bound checking, for performance reason.

Returns the length for value at index i.

Note this doesn’t do any bound checking, for performance reason.

Trait Implementations

Returns the array as Any so that it can be downcasted to a specific implementation. Read more

Returns a reference to the underlying data of this array.

Returns a reference-counted pointer to the underlying data of this array.

Returns a reference to the DataType of this array. Read more

Returns a zero-copy slice of this array with the indicated offset and length. Read more

Returns the length (i.e., number of elements) of this array. Read more

Returns whether this array is empty. Read more

Returns the offset into the underlying data used by this array(-slice). Note that the underlying data can be shared by many arrays. This defaults to 0. Read more

Returns whether the element at index is null. When using this function on a slice, the index is relative to the slice. Read more

Returns whether the element at index is not null. When using this function on a slice, the index is relative to the slice. Read more

Returns the total number of null values in this array. Read more

Returns the total number of bytes of memory pointed to by this array. The buffers store bytes in the Arrow memory format, and include the data as well as the validity map. Read more

Returns the total number of bytes of memory occupied physically by this array. This value will always be greater than returned by get_buffer_memory_size() and includes the overhead of the data structures that contain the pointers to the various buffers. Read more

returns two pointers that represent this array in the C Data Interface (FFI)

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Creates a FixedSizeBinaryArray from FixedSizeList<u8> array

Converts to this type from the input type.

Checks whether arrow array equals to json array.

Checks whether arrow array equals to json array.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.