Skip to main content

EntityPolicy

Trait EntityPolicy 

Source
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§

Source

const POLICY_NAME: &'static str

Provided Associated Constants§

Source

const COLUMN_NAMES: &'static [&'static str] = _

Required Methods§

Source

fn columns() -> &'static [ColumnMetadata]

Provided Methods§

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.

Implementors§