Skip to main content

PropertyIndex

Trait PropertyIndex 

Source
pub trait PropertyIndex:
    PropertyIndex
    + Copy
    + Ord {
    type ArrowType: ArrowPrimitiveType<Native = Self> + 'static;
    type LittleEndianWord: FromBytes + Immutable + IntoBytes + KnownLayout + Unaligned + Copy;

    // Required methods
    fn to_usize(self) -> Option<usize>;
    fn from_usize(value: usize) -> Option<Self>;
    fn from_u64(value: u64) -> Option<Self>;
    fn to_u64(self) -> u64;
    fn to_le_word(self) -> Self::LittleEndianWord;
    fn from_le_word(word: Self::LittleEndianWord) -> Self;
    fn primitive_array(values: Vec<Self>) -> PrimitiveArray<Self::ArrowType>;
}
Expand description

Unsigned index width usable for sparse property indexes.

§Performance

Implementations perform checked conversions in O(1).

Required Associated Types§

Source

type ArrowType: ArrowPrimitiveType<Native = Self> + 'static

Arrow unsigned primitive type for sparse index arrays.

Source

type LittleEndianWord: FromBytes + Immutable + IntoBytes + KnownLayout + Unaligned + Copy

Little-endian word used when this width appears in snapshots.

Required Methods§

Source

fn to_usize(self) -> Option<usize>

Returns self as usize, or None if the target platform cannot hold it.

§Performance

This function is O(1).

Source

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

Converts value into this index width if it fits.

§Performance

This function is O(1).

Source

fn from_u64(value: u64) -> Option<Self>

Converts value into this index width if it fits.

§Performance

This function is O(1).

Source

fn to_u64(self) -> u64

Returns self as u64 for diagnostics.

§Performance

This function is O(1).

Source

fn to_le_word(self) -> Self::LittleEndianWord

Encodes self as a little-endian snapshot word.

§Performance

This function is O(1).

Source

fn from_le_word(word: Self::LittleEndianWord) -> Self

Decodes a little-endian snapshot word.

§Performance

This function is O(1).

Source

fn primitive_array(values: Vec<Self>) -> PrimitiveArray<Self::ArrowType>

Builds an Arrow primitive array from native index values.

§Performance

This function is O(values.len()).

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 PropertyIndex for u16

Source§

impl PropertyIndex for u32

Source§

impl PropertyIndex for u64

Implementors§