Skip to main content

PrimaryKeyTrait

Trait PrimaryKeyTrait 

Source
pub trait PrimaryKeyTrait: IdenStatic + Iterable {
    type ValueType: IntoValueTuple + TryFromU64 + Clone + Debug + Send + Sync;

    // Required method
    fn auto_increment() -> bool;
}
Expand description

The primary key of an entity, derived on the PrimaryKey enum.

Required Associated Types§

Source

type ValueType: IntoValueTuple + TryFromU64 + Clone + Debug + Send + Sync

The Rust type of the key: the field type for a single column, a tuple of field types for a composite key.

Required Methods§

Source

fn auto_increment() -> bool

Whether the database generates the key, as with INTEGER PRIMARY KEY.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§