Trait re_viewer::external::arrow2::array::DictionaryKey

pub unsafe trait DictionaryKey: NativeType + TryInto<usize> + TryFrom<usize> + Hash {
    const KEY_TYPE: IntegerType;

    // Provided methods
    unsafe fn as_usize(self) -> usize { ... }
    fn always_fits_usize() -> bool { ... }
}
Expand description

Trait denoting NativeTypes that can be used as keys of a dictionary.

§Safety

Any implementation of this trait must ensure that always_fits_usize only returns true if all values succeeds on value::try_into::<usize>().unwrap().

Required Associated Constants§

const KEY_TYPE: IntegerType

The corresponding IntegerType of this key

Provided Methods§

unsafe fn as_usize(self) -> usize

Represents this key as a usize.

§Safety

The caller must have checked that the value can be casted to usize.

fn always_fits_usize() -> bool

If the key type always can be converted to usize.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl DictionaryKey for i8

§

const KEY_TYPE: IntegerType = IntegerType::Int8

§

impl DictionaryKey for i16

§

const KEY_TYPE: IntegerType = IntegerType::Int16

§

impl DictionaryKey for i32

§

const KEY_TYPE: IntegerType = IntegerType::Int32

§

impl DictionaryKey for i64

§

const KEY_TYPE: IntegerType = IntegerType::Int64

§

impl DictionaryKey for u8

§

const KEY_TYPE: IntegerType = IntegerType::UInt8

§

fn always_fits_usize() -> bool

§

impl DictionaryKey for u16

§

const KEY_TYPE: IntegerType = IntegerType::UInt16

§

fn always_fits_usize() -> bool

§

impl DictionaryKey for u32

§

const KEY_TYPE: IntegerType = IntegerType::UInt32

§

fn always_fits_usize() -> bool

§

impl DictionaryKey for u64

§

const KEY_TYPE: IntegerType = IntegerType::UInt64

§

fn always_fits_usize() -> bool

Implementors§