arrow::datatypes

Trait ByteArrayType

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 Constants§

const PREFIX: &'static str

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

const DATA_TYPE: DataType

Datatype of array elements

Required Associated Types§

type Offset: OffsetSizeTrait

Type of offset i.e i32/i64

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 Methods§

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

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

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

§

const PREFIX: &'static str = "Binary"

§

const DATA_TYPE: DataType = _

§

type Offset = O

§

type Native = [u8]

§

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

§

const PREFIX: &'static str = "String"

§

const DATA_TYPE: DataType = _

§

type Offset = O

§

type Native = str