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

    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§

The corresponding IntegerType of this key

Provided Methods§

Represents this key as a usize.

Safety

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

If the key type always can be converted to usize.

Implementations on Foreign Types§

Implementors§