pub trait Entity:
Send
+ Sync
+ Sized {
type Id: Debug + Clone + PartialEq + Eq + Hash + Send + Sync + Into<Value>;
// Required methods
fn table_name() -> &'static str;
fn id_column() -> &'static str;
fn columns() -> &'static [Column];
fn id(&self) -> Self::Id;
fn values(&self) -> Vec<Value>;
}Expand description
Describes the schema of a database-backed entity.
Implementors specify the table name, columns, and primary key column so that fletch can generate SQL for CRUD operations.
Required Associated Types§
Required Methods§
Sourcefn table_name() -> &'static str
fn table_name() -> &'static str
The database table name for this entity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".