Trait arrow::array::types::ByteArrayType

source ·
pub trait ByteArrayType:
    'static
    + Send
    + Sync
    + ByteArrayTypeSealed {
    type Offset: OffsetSizeTrait;
    type Native: ByteArrayNativeType + AsRef<Self::Native> + AsRef<[u8]> + ?Sized;

    const PREFIX: &'static str;
    const DATA_TYPE: DataType;

    // Required method
    fn validate(
        offsets: &OffsetBuffer<Self::Offset>,
        values: &Buffer,
    ) -> Result<(), ArrowError>;
}
Expand description

A trait over the variable-size byte array types

See Variable Size Binary Layout

Required Associated Types§

source

type Offset: OffsetSizeTrait

Type of offset i.e i32/i64

source

type Native: ByteArrayNativeType + AsRef<Self::Native> + AsRef<[u8]> + ?Sized

Type for representing its equivalent rust type i.e Utf8Array will have native type has &str BinaryArray will have type as u8

Required Associated Constants§

source

const PREFIX: &'static str

“Binary” or “String”, for use in error messages

source

const DATA_TYPE: DataType

Datatype of array elements

Required Methods§

source

fn validate( offsets: &OffsetBuffer<Self::Offset>, values: &Buffer, ) -> Result<(), ArrowError>

Verifies that every consecutive pair of offsets denotes a valid slice of values

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O> ByteArrayType for GenericBinaryType<O>
where O: OffsetSizeTrait,

§

type Offset = O

§

type Native = [u8]

source§

const PREFIX: &'static str = "Binary"

source§

const DATA_TYPE: DataType = _

source§

impl<O> ByteArrayType for GenericStringType<O>
where O: OffsetSizeTrait,

§

type Offset = O

§

type Native = str

source§

const PREFIX: &'static str = "String"

source§

const DATA_TYPE: DataType = _