Skip to main content

TableSchema

Type Alias TableSchema 

Source
pub type TableSchema<TD> = <TD as TableDefinition>::KeySchema;
Expand description

Convenience alias for the KeySchema of a TableDefinition.

Use this alias in generic bounds and function signatures to avoid spelling out the full associated-type projection every time you need to refer to a table’s key schema type.

§Examples

use dynamodb_facade::{CompositeKeySchema, TableDefinition, TableSchema};

// Require that a table's key schema is composite (has both PK and SK).
fn requires_composite_table<TD: TableDefinition>()
where
    TableSchema<TD>: CompositeKeySchema,
{}

// PlatformTable has PK + SK, so this compiles.
requires_composite_table::<PlatformTable>();