Struct arrow::array::FixedSizeBinaryArray
source · [−]pub struct FixedSizeBinaryArray { /* private fields */ }
Expand description
A type of FixedSizeListArray
whose elements are binaries.
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.
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
pub fn try_from_sparse_iter<T, U>(iter: T) -> Result<Self, ArrowError> where
T: Iterator<Item = Option<U>>,
U: AsRef<[u8]>,
pub fn try_from_sparse_iter<T, U>(iter: T) -> Result<Self, ArrowError> where
T: Iterator<Item = Option<U>>,
U: AsRef<[u8]>,
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.
pub fn try_from_iter<T, U>(iter: T) -> Result<Self, ArrowError> where
T: Iterator<Item = U>,
U: AsRef<[u8]>,
pub fn try_from_iter<T, U>(iter: T) -> Result<Self, ArrowError> where
T: Iterator<Item = U>,
U: AsRef<[u8]>,
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.
Trait Implementations
Returns a reference-counted pointer to the underlying data of this array.
Returns a zero-copy slice of this array with the indicated offset and length. 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)
Creates a FixedSizeBinaryArray
from FixedSizeList<u8>
array
Performs the conversion.