pub trait EntityPolicy:
Sized
+ Send
+ Sync
+ 'static {
const POLICY_NAME: &'static str;
const COLUMN_NAMES: &'static [&'static str] = _;
// Required method
fn columns() -> &'static [ColumnMetadata];
// Provided method
fn metadata() -> EntityPolicyMetadata { ... }
}Expand description
Stable contract for reusable code-first policies that contribute normal columns.
Required Associated Constants§
const POLICY_NAME: &'static str
Provided Associated Constants§
const COLUMN_NAMES: &'static [&'static str] = _
Required Methods§
fn columns() -> &'static [ColumnMetadata]
Provided Methods§
fn metadata() -> EntityPolicyMetadata
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.