Type that can act as the key for a [`Table`]. Defines how a given type is to be converted into a raw byte array. The chosen byte representation also defines the iteration order and behavior of [`Table::range`] functions. Tables are ordered in lexicographic order of the keys after conversion via [`Self::into_raw`]. You'll want to **output all integer keys with ordinal semantics in big endian to e
| 328 | /// You'll want to **output all integer keys with ordinal semantics in big |
| 329 | /// endian to ensure that the ordering works correctly**. |
| 330 | pub trait TableKey: 'static { |
| 331 | /// Container type for the raw representation of the key. |
| 332 | /// |
| 333 | /// Typically `[u8; N]`, but can also be something dynamic like `Vec<u8>`. |
| 334 | type B: for<'a> TryFrom<&'a [u8]> + AsRef<[u8]>; |
| 335 | |
| 336 | /// Load the raw container as a typed value. |
| 337 | fn from_raw(data: Self::B) -> Self; |
| 338 | |
| 339 | /// Store the typed value as the raw container. |
| 340 | fn into_raw(self) -> Self::B; |
| 341 | } |
| 342 | |
| 343 | /// Implements Rust ordering trait via the table key. |
| 344 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected