Trait otter_api_tests::KeyDataExt[][src]

pub trait KeyDataExt {
    fn get_idx_version(self) -> (u32, u32);
}
Expand description

Extension trait for slotmap::KeyData, providing get_idx_version.

No-one is expected to implement this trait for anything else.

Required methods

Returns the slot index and version. This is useful only in unusual situations.

At any one time, a slotmap has at most one entry with each index. The combination of index and version are unique across time. Indices are generally not significantly bigger than thw maximum ever occupancy. No other guarantees are made.

For serialisation, use serde or as_ffi.

panics:

This function panics if the slotmap::KeyData serde::ser::Serialize representation has changed too much. This ought to be caught by the tests, and would probably be a breaking change in the underlying slotmap crate in any case.

If you prefer to receive an error rather than panicing, see keydata_extract.

Implementors