arrow_array::types

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

Source

const PREFIX: &'static str

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

Source

const DATA_TYPE: DataType

Datatype of array elements

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

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§

Source§

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

Source§

const PREFIX: &'static str = "Binary"

Source§

const DATA_TYPE: DataType = _

Source§

type Offset = O

Source§

type Native = [u8]

Source§

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

Source§

const PREFIX: &'static str = "String"

Source§

const DATA_TYPE: DataType = _

Source§

type Offset = O

Source§

type Native = str