pub struct DirectoryEntry {
pub key: String,
pub id: u64,
}Expand description
One directory row: a natural key (e.g. a normalized email) → a
shard-encoded id. The shard lives inside the id, so no shard column is
needed and resolving a key is a single global lookup.
Fields§
§key: String§id: u64Shard-encoded — resolving this is the only lookup a router needs.
Trait Implementations§
Source§impl Clone for DirectoryEntry
impl Clone for DirectoryEntry
Source§impl Debug for DirectoryEntry
impl Debug for DirectoryEntry
Source§impl Entity for DirectoryEntry
impl Entity for DirectoryEntry
Source§fn columns() -> &'static [ColumnSpec]
fn columns() -> &'static [ColumnSpec]
Column metadata, in declaration order. Drives both DDL generation and
the column list of generated
INSERTs.Source§fn primary_key() -> &'static str
fn primary_key() -> &'static str
The primary-key column name. Used by
find_by_pk / update /
delete_by_pk.Source§fn indexes() -> &'static [IndexSpec]
fn indexes() -> &'static [IndexSpec]
Secondary indexes (single-column and composite, unique or not),
emitted as separate
CREATE INDEX statements by crate::schema.
Defaults to none.Source§fn foreign_keys() -> &'static [ForeignKeySpec]
fn foreign_keys() -> &'static [ForeignKeySpec]
Foreign-key constraints, emitted inline in the
CREATE TABLE. These
enforce referential integrity within one database; they are not ORM
relationships (no navigation is generated). Defaults to none.Source§fn shard_columns() -> &'static [&'static str]
fn shard_columns() -> &'static [&'static str]
Columns whose values are the shard key — a shard-encoded id
(
#[orm(shard_key)]), the “user id by proxy”. When a query constrains
one of these, the repo layer routes the operation to that id’s shard. Read moreSource§fn from_row(row: &dyn Row) -> Result<Self, Error>
fn from_row(row: &dyn Row) -> Result<Self, Error>
Decode one row into
Self. Generated to read each field through its
FromColumn impl.Source§fn insert_values(&self) -> Vec<(&'static str, Value)>
fn insert_values(&self) -> Vec<(&'static str, Value)>
(column, value) pairs for an INSERT. Auto-increment primary keys
are omitted so the database assigns them.impl Eq for DirectoryEntry
Source§impl PartialEq for DirectoryEntry
impl PartialEq for DirectoryEntry
impl StructuralPartialEq for DirectoryEntry
Auto Trait Implementations§
impl Freeze for DirectoryEntry
impl RefUnwindSafe for DirectoryEntry
impl Send for DirectoryEntry
impl Sync for DirectoryEntry
impl Unpin for DirectoryEntry
impl UnsafeUnpin for DirectoryEntry
impl UnwindSafe for DirectoryEntry
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
Mutably borrows from an owned value. Read more