pub trait Linked {
type FromEntity: EntityTrait;
type ToEntity: EntityTrait;
// Required method
fn link(&self) -> Vec<LinkDef> ⓘ;
// Provided method
fn find_linked(&self) -> Select<Self::ToEntity> { ... }
}Expand description
A multi-hop traversal between two entities: a chain of LinkDef hops
from FromEntity to ToEntity.
Use this when a single Related edge can’t express
the path (for example, “user → post → comment → author”). Implement
link to return the ordered list of hops; SeaORM joins
them when ModelTrait::find_linked is
called.
Required Associated Types§
Sourcetype FromEntity: EntityTrait
type FromEntity: EntityTrait
Entity at the start of the chain.
Sourcetype ToEntity: EntityTrait
type ToEntity: EntityTrait
Entity reached at the end of the chain.
Required Methods§
Provided Methods§
Sourcefn find_linked(&self) -> Select<Self::ToEntity>
fn find_linked(&self) -> Select<Self::ToEntity>
Build a Select<ToEntity> that follows the chain.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".