Skip to main content

KeySchema

Trait KeySchema 

Source
pub trait KeySchema: ValidKeySchema<Self::Kind> {
    type Kind: KeySchemaKind;
    type PartitionKey: AttributeDefinition;
}
Expand description

Defines the key schema for a DynamoDB table or index.

A key schema specifies the partition key attribute and the key kind (SimpleKey or CompositeKey). Implementations are generated by key_schema!, table_definitions!, and index_definitions! — you rarely implement this trait manually.

For composite key schemas, also implement CompositeKeySchema to expose the sort key type. For simple key schemas, also implement SimpleKeySchema.

§Examples

use dynamodb_facade::{KeySchema, TableSchema};

fn _assert<KS: KeySchema>() {}
// PlatformTable's KeySchema associated type implements the KeySchema trait.
_assert::<TableSchema<PlatformTable>>();

Required Associated Types§

Source

type Kind: KeySchemaKind

Whether this schema has a sort key (CompositeKey) or not (SimpleKey).

Source

type PartitionKey: AttributeDefinition

The partition key attribute definition.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§