pub struct MorphTo {
pub morph_type_column: String,
pub morph_id_column: String,
}Expand description
多态反向配置(子模型侧)
例:Comment 属于 Post 或 Video,Comment 表中有 commentable_type + commentable_id。
加载 Comment.commentable 时,根据 commentable_type 路由到不同表。
Fields§
§morph_type_column: String当前模型中标识父类型的列名(如 “commentable_type”)
morph_id_column: String当前模型中标识父主键的列名(如 “commentable_id”)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MorphTo
impl RefUnwindSafe for MorphTo
impl Send for MorphTo
impl Sync for MorphTo
impl Unpin for MorphTo
impl UnsafeUnpin for MorphTo
impl UnwindSafe for MorphTo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more