Struct re_viewer::external::arrow2::array::FixedSizeBinaryArray
pub struct FixedSizeBinaryArray {
size: usize,
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>,
}
Expand description
The Arrow’s equivalent to an immutable Vec<Option<[u8; size]>>
.
Cloning and slicing this struct is O(1)
.
Fields§
§size: usize
§data_type: DataType
§values: Buffer<u8>
§validity: Option<Bitmap>
Implementations§
§impl<'a> FixedSizeBinaryArray
impl<'a> FixedSizeBinaryArray
pub fn iter(
&'a self
) -> ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>> ⓘ
pub fn iter( &'a self ) -> ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>> ⓘ
constructs a new iterator
pub fn values_iter(&'a self) -> ChunksExact<'a, u8>
pub fn values_iter(&'a self) -> ChunksExact<'a, u8>
Returns iterator over the values of FixedSizeBinaryArray
§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
pub fn try_new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Result<FixedSizeBinaryArray, Error>
pub fn try_new( data_type: DataType, values: Buffer<u8>, validity: Option<Bitmap> ) -> Result<FixedSizeBinaryArray, Error>
Creates a new FixedSizeBinaryArray
.
§Errors
This function returns an error iff:
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeBinary
- The length of
values
is not a multiple ofsize
indata_type
- the validity’s length is not equal to
values.len() / size
.
pub fn new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> FixedSizeBinaryArray
pub fn new( data_type: DataType, values: Buffer<u8>, validity: Option<Bitmap> ) -> FixedSizeBinaryArray
Creates a new FixedSizeBinaryArray
.
§Panics
This function panics iff:
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeBinary
- The length of
values
is not a multiple ofsize
indata_type
- the validity’s length is not equal to
values.len() / size
.
pub fn new_empty(data_type: DataType) -> FixedSizeBinaryArray
pub fn new_empty(data_type: DataType) -> FixedSizeBinaryArray
Returns a new empty FixedSizeBinaryArray
.
pub fn new_null(data_type: DataType, length: usize) -> FixedSizeBinaryArray
pub fn new_null(data_type: DataType, length: usize) -> FixedSizeBinaryArray
Returns a new null FixedSizeBinaryArray
.
§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
pub fn slice(&mut self, offset: usize, length: usize)
pub fn slice(&mut self, offset: usize, length: usize)
Slices this FixedSizeBinaryArray
.
§Implementation
This operation is O(1)
.
§Panics
panics iff offset + length > self.len()
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
Slices this FixedSizeBinaryArray
.
§Implementation
This operation is O(1)
.
§Safety
The caller must ensure that offset + length <= self.len()
.
pub fn sliced(self, offset: usize, length: usize) -> FixedSizeBinaryArray
pub fn sliced(self, offset: usize, length: usize) -> FixedSizeBinaryArray
pub unsafe fn sliced_unchecked(
self,
offset: usize,
length: usize
) -> FixedSizeBinaryArray
pub unsafe fn sliced_unchecked( self, offset: usize, length: usize ) -> FixedSizeBinaryArray
pub fn with_validity(self, validity: Option<Bitmap>) -> FixedSizeBinaryArray
pub fn with_validity(self, validity: Option<Bitmap>) -> FixedSizeBinaryArray
pub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn boxed(self) -> Box<dyn Array>
pub fn boxed(self) -> Box<dyn Array>
Boxes this array into a Box<dyn Array>
.
pub fn arced(self) -> Arc<dyn Array>
pub fn arced(self) -> Arc<dyn Array>
Arcs this array into a std::sync::Arc<dyn Array>
.
§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
pub fn values(&self) -> &Buffer<u8>
pub fn values(&self) -> &Buffer<u8>
Returns the values allocated on this FixedSizeBinaryArray
.
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub fn to(self, data_type: DataType) -> FixedSizeBinaryArray
pub fn to(self, data_type: DataType) -> FixedSizeBinaryArray
Returns a new FixedSizeBinaryArray
with a different logical type.
This is O(1)
.
§Panics
Panics iff the data_type is not supported for the physical type.
§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
pub fn try_from_iter<P, I>(
iter: I,
size: usize
) -> Result<FixedSizeBinaryArray, Error>
pub fn try_from_iter<P, I>( iter: I, size: usize ) -> Result<FixedSizeBinaryArray, Error>
Creates a FixedSizeBinaryArray
from an fallible iterator of optional [u8]
.
pub fn from_iter<P, I>(iter: I, size: usize) -> FixedSizeBinaryArray
pub fn from_iter<P, I>(iter: I, size: usize) -> FixedSizeBinaryArray
Creates a FixedSizeBinaryArray
from an iterator of optional [u8]
.
pub fn from_slice<const N: usize, P>(a: P) -> FixedSizeBinaryArray
pub fn from_slice<const N: usize, P>(a: P) -> FixedSizeBinaryArray
Creates a FixedSizeBinaryArray
from a slice of arrays of bytes
pub fn from<const N: usize, P>(slice: P) -> FixedSizeBinaryArray
pub fn from<const N: usize, P>(slice: P) -> FixedSizeBinaryArray
Creates a new FixedSizeBinaryArray
from a slice of optional [u8]
.
Trait Implementations§
§impl Arrow2Arrow for FixedSizeBinaryArray
impl Arrow2Arrow for FixedSizeBinaryArray
§impl Array for FixedSizeBinaryArray
impl Array for FixedSizeBinaryArray
§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
, which enables downcasting to concrete types.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
, which enables mutable downcasting to concrete types.§fn len(&self) -> usize
fn len(&self) -> usize
Array
. Every array has a length corresponding to the number of
elements (slots).§fn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays.§fn null_count(&self) -> usize
fn null_count(&self) -> usize
§unsafe fn is_null_unchecked(&self, i: usize) -> bool
unsafe fn is_null_unchecked(&self, i: usize) -> bool
i
is null. Read more§impl Clone for FixedSizeBinaryArray
impl Clone for FixedSizeBinaryArray
§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 more§impl Debug for FixedSizeBinaryArray
impl Debug for FixedSizeBinaryArray
§impl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
impl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
§fn from(val: GrowableFixedSizeBinary<'a>) -> FixedSizeBinaryArray
fn from(val: GrowableFixedSizeBinary<'a>) -> FixedSizeBinaryArray
§impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
§fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
§impl<'a> IntoIterator for &'a FixedSizeBinaryArray
impl<'a> IntoIterator for &'a FixedSizeBinaryArray
§type IntoIter = ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>
type IntoIter = ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>
§fn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
§impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
§impl PartialEq for FixedSizeBinaryArray
impl PartialEq for FixedSizeBinaryArray
§fn eq(&self, other: &FixedSizeBinaryArray) -> bool
fn eq(&self, other: &FixedSizeBinaryArray) -> bool
self
and other
values to be equal, and is used
by ==
.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> 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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request