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

An array where each element is a fixed-size sequence of bytes.

Examples

Create an array from an iterable argument of byte slices.

   use arrow_array::{Array, FixedSizeBinaryArray};
   let input_arg = vec![ vec![1, 2], vec![3, 4], vec![5, 6] ];
   let arr = FixedSizeBinaryArray::try_from_iter(input_arg.into_iter()).unwrap();

   assert_eq!(3, arr.len());

Create an array from an iterable argument of sparse byte slices. Sparsity means that the input argument can contain None items.

   use arrow_array::{Array, FixedSizeBinaryArray};
   let input_arg = vec![ None, Some(vec![7, 8]), Some(vec![9, 10]), None, Some(vec![13, 14]) ];
   let arr = FixedSizeBinaryArray::try_from_sparse_iter(input_arg.into_iter()).unwrap();
   assert_eq!(5, arr.len())

Implementations§

Returns the element at index i as a byte slice.

Panics

Panics if index i is out of bounds.

Returns the element at index i as a byte slice.

Safety

Caller is responsible for ensuring that the index is within the bounds of the array

Returns the offset for the element at index i.

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

Returns the length for an element.

All elements have the same length as the array is a fixed size.

Returns a clone of the value data buffer

👎Deprecated: This function will fail if the iterator produces only None values; prefer try_from_sparse_iter_with_size

Create an array from an iterable argument of sparse byte slices. Sparsity means that items returned by the iterator are optional, i.e input argument can contain None items.

Examples
use arrow_array::FixedSizeBinaryArray;
let input_arg = vec![
    None,
    Some(vec![7, 8]),
    Some(vec![9, 10]),
    None,
    Some(vec![13, 14]),
    None,
];
let array = FixedSizeBinaryArray::try_from_sparse_iter(input_arg.into_iter()).unwrap();
Errors

Returns error if argument has length zero, or sizes of nested slices don’t match.

Create an array from an iterable argument of sparse byte slices. Sparsity means that items returned by the iterator are optional, i.e input argument can contain None items. In cases where the iterator returns only None values, this also takes a size parameter to ensure that the a valid FixedSizeBinaryArray is still created.

Examples
use arrow_array::FixedSizeBinaryArray;
let input_arg = vec![
    None,
    Some(vec![7, 8]),
    Some(vec![9, 10]),
    None,
    Some(vec![13, 14]),
    None,
];
let array = FixedSizeBinaryArray::try_from_sparse_iter_with_size(input_arg.into_iter(), 2).unwrap();
Errors

Returns error if argument has length zero, or sizes of nested slices don’t match.

Create an array from an iterable argument of byte slices.

Examples
use arrow_array::FixedSizeBinaryArray;
let input_arg = vec![
    vec![1, 2],
    vec![3, 4],
    vec![5, 6],
];
let array = FixedSizeBinaryArray::try_from_iter(input_arg.into_iter()).unwrap();
Errors

Returns error if argument has length zero, or sizes of nested slices don’t match.

constructs a new iterator

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 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.
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.
The Arrow type of the element being accessed.
Returns the element at index i Read more
Returns the element at index i Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Creates a FixedSizeBinaryArray from FixedSizeList<u8> array

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.