pub trait UniqueEntityImplementationHelper {
const TABLE_NAME: &str;
// Required methods
fn new(content: Vec<u8>) -> Self;
fn content(&self) -> &[u8] ⓘ;
}Expand description
Unique entity implementation/migration helper.
Few unique entities actually care about what key gets used; it’s arbitrary, imposed
only by the requirement that an Entity has a PrimaryKey. Really they only need
to know what table name to use, and how to serialize/deserialize. For reasons of
historical compatibility we express the serialization requirements in terms of inline
methods here instead of a trait implementation.
If you implement this trait, you get the following traits auto-implemented:
PrimaryKeyUniqueEntityEntityEntityDatabaseMutation
Required Associated Constants§
Sourceconst TABLE_NAME: &str
const TABLE_NAME: &str
Table name for this entity.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".