Skip to main content

RelationTrait

Trait RelationTrait 

Source
pub trait RelationTrait:
    Iterable
    + Debug
    + 'static {
    // Required method
    fn def(&self) -> RelationDef;

    // Provided method
    fn name(&self) -> String { ... }
}
Expand description

Each variant of an entity’s Relation enum implements this trait, providing the RelationDef that backs joins, foreign keys, and related-model lookups.

Usually generated by #[derive(DeriveRelation)] (or by #[sea_orm::model] in the 2.0 dense format).

Required Methods§

Source

fn def(&self) -> RelationDef

The RelationDef describing this relation.

Provided Methods§

Source

fn name(&self) -> String

Name of the relation variant (e.g. "Fruit"), used for diagnostics.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl RelationTrait for sea_orm::rbac::entity::permission::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::resource::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::role::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::role_hierarchy::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::role_permission::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::user_override::Relation

Available on crate feature rbac only.
Source§

impl RelationTrait for sea_orm::rbac::entity::user_role::Relation

Available on crate feature rbac only.