pub struct TableId { /* private fields */ }Expand description
Composite key for system.tables entries: (namespace_id, table_name)
This composite key provides type-safe access to table metadata, ensuring namespace and table name are always paired correctly.
§Serialization
Serializes as “namespace.table” string format for JSON compatibility.
For example: "flush_test_ns_mkav1q2g_3.metrics"
Implementations§
Source§impl TableId
impl TableId
Sourcepub fn new(namespace_id: NamespaceId, table_name: TableName) -> TableId
pub fn new(namespace_id: NamespaceId, table_name: TableName) -> TableId
Create a new TableId from namespace ID and table name
Sourcepub fn namespace_id(&self) -> &NamespaceId
pub fn namespace_id(&self) -> &NamespaceId
Get the namespace ID component
Sourcepub fn table_name(&self) -> &TableName
pub fn table_name(&self) -> &TableName
Get the table name component
Sourcepub fn from_strings(namespace_id: &str, table_name: &str) -> TableId
pub fn from_strings(namespace_id: &str, table_name: &str) -> TableId
Create from string components
Sourcepub fn try_from_strings(
namespace_id: &str,
table_name: &str,
) -> Result<TableId, String>
pub fn try_from_strings( namespace_id: &str, table_name: &str, ) -> Result<TableId, String>
Create from string components with validation errors instead of panics.
Sourcepub fn namespace_prefix(namespace_id: &NamespaceId) -> Vec<u8> ⓘ
pub fn namespace_prefix(namespace_id: &NamespaceId) -> Vec<u8> ⓘ
Create a prefix for scanning all tables in a namespace.
Sourcepub fn as_storage_key(&self) -> Vec<u8> ⓘ
pub fn as_storage_key(&self) -> Vec<u8> ⓘ
Format as bytes for storage using storekey tuple encoding
Sourcepub fn from_storage_key(key: &[u8]) -> Option<TableId>
pub fn from_storage_key(key: &[u8]) -> Option<TableId>
Parse from storage key bytes
Sourcepub fn into_parts(self) -> (NamespaceId, TableName)
pub fn into_parts(self) -> (NamespaceId, TableName)
Consume and return inner components
Trait Implementations§
Source§impl AsRef<[u8]> for TableId
Implement AsRef<u8> for EntityStore compatibility
impl AsRef<[u8]> for TableId
Implement AsRef<u8> for EntityStore compatibility
This allocates a new Vec on each call. For performance-critical paths, consider using as_storage_key() directly instead.
Source§impl<'de> Deserialize<'de> for TableId
impl<'de> Deserialize<'de> for TableId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<TableId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<TableId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for TableId
Source§impl Serialize for TableId
impl Serialize for TableId
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl StorageKey for TableId
impl StorageKey for TableId
impl StructuralPartialEq for TableId
Auto Trait Implementations§
impl Freeze for TableId
impl RefUnwindSafe for TableId
impl Send for TableId
impl Sync for TableId
impl Unpin for TableId
impl UnsafeUnpin for TableId
impl UnwindSafe for TableId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.