pub struct FixedSizeBinaryArray { /* private fields */ }
Expand description
An array of fixed size binary arrays
§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_with_size(input_arg.into_iter(), 2).unwrap();
assert_eq!(5, arr.len())
Implementations§
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
Sourcepub fn new(
size: i32,
values: Buffer,
nulls: Option<NullBuffer>,
) -> FixedSizeBinaryArray
pub fn new( size: i32, values: Buffer, nulls: Option<NullBuffer>, ) -> FixedSizeBinaryArray
Create a new FixedSizeBinaryArray
with size
element size, panicking on failure
§Panics
Panics if Self::try_new
returns an error
Sourcepub fn new_scalar(value: impl AsRef<[u8]>) -> Scalar<FixedSizeBinaryArray>
pub fn new_scalar(value: impl AsRef<[u8]>) -> Scalar<FixedSizeBinaryArray>
Create a new Scalar
from value
Sourcepub fn try_new(
size: i32,
values: Buffer,
nulls: Option<NullBuffer>,
) -> Result<FixedSizeBinaryArray, ArrowError>
pub fn try_new( size: i32, values: Buffer, nulls: Option<NullBuffer>, ) -> Result<FixedSizeBinaryArray, ArrowError>
Create a new FixedSizeBinaryArray
from the provided parts, returning an error on failure
§Errors
size < 0
values.len() / size != nulls.len()
Sourcepub fn new_null(size: i32, len: usize) -> FixedSizeBinaryArray
pub fn new_null(size: i32, len: usize) -> FixedSizeBinaryArray
Create a new FixedSizeBinaryArray
of length len
where all values are null
§Panics
Panics if
size < 0
size * len
would overflowusize
Sourcepub fn into_parts(self) -> (i32, Buffer, Option<NullBuffer>)
pub fn into_parts(self) -> (i32, Buffer, Option<NullBuffer>)
Deconstruct this array into its constituent parts
Sourcepub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
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
Sourcepub fn value_offset(&self, i: usize) -> i32
pub fn value_offset(&self, i: usize) -> i32
Returns the offset for the element at index i
.
Note this doesn’t do any bound checking, for performance reason.
Sourcepub fn value_length(&self) -> i32
pub fn value_length(&self) -> i32
Returns the length for an element.
All elements have the same length as the array is a fixed size.
Sourcepub fn values(&self) -> &Buffer
pub fn values(&self) -> &Buffer
Returns the values of this array.
Unlike Self::value_data
this returns the Buffer
allowing for zero-copy cloning.
Sourcepub fn value_data(&self) -> &[u8] ⓘ
pub fn value_data(&self) -> &[u8] ⓘ
Returns the raw value data.
Sourcepub fn slice(&self, offset: usize, len: usize) -> FixedSizeBinaryArray
pub fn slice(&self, offset: usize, len: usize) -> FixedSizeBinaryArray
Returns a zero-copy slice of this array with the indicated offset and length.
Sourcepub fn try_from_sparse_iter<T, U>(
iter: T,
) -> Result<FixedSizeBinaryArray, ArrowError>
👎Deprecated since 28.0.0: This function will fail if the iterator produces only None values; prefer try_from_sparse_iter_with_size
pub fn try_from_sparse_iter<T, U>( iter: T, ) -> Result<FixedSizeBinaryArray, ArrowError>
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.
Sourcepub fn try_from_sparse_iter_with_size<T, U>(
iter: T,
size: i32,
) -> Result<FixedSizeBinaryArray, ArrowError>
pub fn try_from_sparse_iter_with_size<T, U>( iter: T, size: i32, ) -> Result<FixedSizeBinaryArray, ArrowError>
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.
Sourcepub fn try_from_iter<T, U>(iter: T) -> Result<FixedSizeBinaryArray, ArrowError>
pub fn try_from_iter<T, U>(iter: T) -> Result<FixedSizeBinaryArray, ArrowError>
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.
Sourcepub fn iter(&self) -> ArrayIter<&FixedSizeBinaryArray> ⓘ
pub fn iter(&self) -> ArrayIter<&FixedSizeBinaryArray> ⓘ
constructs a new iterator
Trait Implementations§
Source§impl Array for FixedSizeBinaryArray
impl Array for FixedSizeBinaryArray
Source§fn slice(&self, offset: usize, length: usize) -> Arc<dyn Array>
fn slice(&self, offset: usize, length: usize) -> Arc<dyn Array>
Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Source§fn offset(&self) -> usize
fn offset(&self) -> usize
0
. Read moreSource§fn nulls(&self) -> Option<&NullBuffer>
fn nulls(&self) -> Option<&NullBuffer>
Source§fn logical_null_count(&self) -> usize
fn logical_null_count(&self) -> usize
Source§fn get_buffer_memory_size(&self) -> usize
fn get_buffer_memory_size(&self) -> usize
Source§fn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
get_buffer_memory_size()
and
includes the overhead of the data structures that contain the pointers to the various buffers.Source§fn logical_nulls(&self) -> Option<NullBuffer>
fn logical_nulls(&self) -> Option<NullBuffer>
NullBuffer
that represents the logical
null values of this array, if any. Read moreSource§fn null_count(&self) -> usize
fn null_count(&self) -> usize
Source§fn is_nullable(&self) -> bool
fn is_nullable(&self) -> bool
false
if the array is guaranteed to not contain any logical nulls Read moreSource§impl<'a> ArrayAccessor for &'a FixedSizeBinaryArray
impl<'a> ArrayAccessor for &'a FixedSizeBinaryArray
Source§fn value(
&self,
index: usize,
) -> <&'a FixedSizeBinaryArray as ArrayAccessor>::Item
fn value( &self, index: usize, ) -> <&'a FixedSizeBinaryArray as ArrayAccessor>::Item
i
Read moreSource§unsafe fn value_unchecked(
&self,
index: usize,
) -> <&'a FixedSizeBinaryArray as ArrayAccessor>::Item
unsafe fn value_unchecked( &self, index: usize, ) -> <&'a FixedSizeBinaryArray as ArrayAccessor>::Item
i
Read moreSource§impl Clone for FixedSizeBinaryArray
impl Clone for FixedSizeBinaryArray
Source§fn clone(&self) -> FixedSizeBinaryArray
fn clone(&self) -> FixedSizeBinaryArray
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FixedSizeBinaryArray
impl Debug for FixedSizeBinaryArray
Source§impl From<ArrayData> for FixedSizeBinaryArray
impl From<ArrayData> for FixedSizeBinaryArray
Source§fn from(data: ArrayData) -> FixedSizeBinaryArray
fn from(data: ArrayData) -> FixedSizeBinaryArray
Source§impl From<FixedSizeBinaryArray> for ArrayData
impl From<FixedSizeBinaryArray> for ArrayData
Source§fn from(array: FixedSizeBinaryArray) -> ArrayData
fn from(array: FixedSizeBinaryArray) -> ArrayData
Source§impl From<FixedSizeListArray> for FixedSizeBinaryArray
Creates a FixedSizeBinaryArray
from FixedSizeList<u8>
array
impl From<FixedSizeListArray> for FixedSizeBinaryArray
Creates a FixedSizeBinaryArray
from FixedSizeList<u8>
array
Source§fn from(v: FixedSizeListArray) -> FixedSizeBinaryArray
fn from(v: FixedSizeListArray) -> FixedSizeBinaryArray
Source§impl<'a> IntoIterator for &'a FixedSizeBinaryArray
impl<'a> IntoIterator for &'a FixedSizeBinaryArray
Source§type IntoIter = ArrayIter<&'a FixedSizeBinaryArray>
type IntoIter = ArrayIter<&'a FixedSizeBinaryArray>
Source§fn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
Source§impl PartialEq for FixedSizeBinaryArray
impl PartialEq for FixedSizeBinaryArray
Auto Trait Implementations§
impl Freeze for FixedSizeBinaryArray
impl RefUnwindSafe for FixedSizeBinaryArray
impl Send for FixedSizeBinaryArray
impl Sync for FixedSizeBinaryArray
impl Unpin for FixedSizeBinaryArray
impl UnwindSafe for FixedSizeBinaryArray
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read more