Skip to main content

ModelPrimaryKey

Trait ModelPrimaryKey 

Source
pub trait ModelPrimaryKey<PK> {
    // Required method
    fn primary_key(&self) -> PK;
}
Expand description

Accessor for a model’s primary key. Implemented by the macro on every generated model struct so the batch operations can pair returned rows back to the position of their input PK in the request, producing a BatchItemResult with the right index and a NotFound entry for any requested PK that didn’t come back.

Required Methods§

Source

fn primary_key(&self) -> PK

Implementors§