pub trait Auto: Field {
const STRATEGY: AutoStrategy;
}Expand description
A field type that supports automatic value generation.
Types implementing this trait can be used with the #[auto] attribute on
model fields. The database or Toasty runtime assigns values for these
fields automatically when a new record is created.
Built-in implementations:
| Type | Strategy |
|---|---|
Integer types (i8..i64, u8..u64, isize, usize) | Auto-increment |
uuid::Uuid | UUID v7 |
Required Associated Constants§
Sourceconst STRATEGY: AutoStrategy
const STRATEGY: AutoStrategy
The strategy the runtime uses to generate values for this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".