MCPcopy Create free account
hub / github.com/elastic/devfiler / TableKey

Interface TableKey

src/storage/table.rs:330–341  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

328/// You'll want to **output all integer keys with ordinal semantics in big
329/// endian to ensure that the ordering works correctly**.
330pub 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///

Callers

nothing calls this directly

Implementers 5

dbtypes.rssrc/storage/dbtypes.rs
table.rssrc/storage/table.rs
stackframes.rssrc/storage/tables/stackframes.rs
stacktraces.rssrc/storage/tables/stacktraces.rs
traceevents.rssrc/storage/tables/traceevents.rs

Calls

no outgoing calls

Tested by

no test coverage detected