Skip to main content

Morphable

Trait Morphable 

Source
pub trait Morphable: EntityTrait {
    const MORPH_TYPE: &'static str;
}
Expand description

An entity that can own polymorphic children, with the name stored in their *_type column.

The name is a short, stable alias like "post": Rust has no class names to store, and an alias survives renaming the entity or moving it to another module.

use sea_orm_relations_kit::Morphable;

impl Morphable for posts::Entity {
    const MORPH_TYPE: &'static str = "post";
}

Required Associated Constants§

Source

const MORPH_TYPE: &'static str

The value stored in the *_type column of this entity’s children.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§