Trait polars_arrow::array::DictionaryKey
source · 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 NativeType
s 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§
sourceconst KEY_TYPE: IntegerType
const KEY_TYPE: IntegerType
The corresponding IntegerType
of this key
Provided Methods§
sourceunsafe fn as_usize(self) -> usize
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
.
sourcefn always_fits_usize() -> bool
fn always_fits_usize() -> bool
If the key type always can be converted to usize
.
Object Safety§
This trait is not object safe.