Skip to main content

OffsetSizeTrait

Trait OffsetSizeTrait 

Source
pub trait OffsetSizeTrait: ArrowNativeType + Ord {
    const IS_LARGE: bool;
    const ZERO: Self;
    const BINARY_TYPE: DataType;
    const UTF8_TYPE: DataType;

    // Required methods
    fn to_usize(self) -> Option<usize>;
    fn from_usize(value: usize) -> Option<Self>;
    fn as_i64(self) -> i64;
}
Expand description

The offset width of a variable-length array: i32 or i64.

Sealed through ArrowNativeType, so the set stays exactly these two.

Required Associated Constants§

Source

const IS_LARGE: bool

true for the 64-bit (Large) variants.

Source

const ZERO: Self

The additive identity, the value every offset buffer starts at.

Source

const BINARY_TYPE: DataType

The Binary/LargeBinary type for this offset width.

Source

const UTF8_TYPE: DataType

The Utf8/LargeUtf8 type for this offset width.

Required Methods§

Source

fn to_usize(self) -> Option<usize>

Converts to usize, or None when negative or too large for the host.

Source

fn from_usize(value: usize) -> Option<Self>

Converts from usize, or None when the value does not fit.

Source

fn as_i64(self) -> i64

Widens to i64 for uniform error reporting.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl OffsetSizeTrait for i32

Source§

const IS_LARGE: bool = false

Source§

const ZERO: Self = 0

Source§

const BINARY_TYPE: DataType = DataType::Binary

Source§

const UTF8_TYPE: DataType = DataType::Utf8

Source§

fn to_usize(self) -> Option<usize>

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn as_i64(self) -> i64

Source§

impl OffsetSizeTrait for i64

Source§

const IS_LARGE: bool = true

Source§

const ZERO: Self = 0

Source§

const BINARY_TYPE: DataType = DataType::LargeBinary

Source§

const UTF8_TYPE: DataType = DataType::LargeUtf8

Source§

fn to_usize(self) -> Option<usize>

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn as_i64(self) -> i64

Implementors§