pub struct BelongsToMany {
pub junction_table: String,
pub foreign_key: String,
pub other_key: String,
pub target_model: String,
pub target_pk: String,
}Expand description
多对多关系配置
关联语义:
junction_table:中间表名(如user_roles)foreign_key:中间表中指向当前模型主键的列名(如user_id)other_key:中间表中指向目标模型主键的列名(如role_id)target_model:目标表名(如roles)target_pk:目标表的主键列名(如id),用于 JOIN 条件t.{target_pk} = j.{other_key}
Fields§
§junction_table: String§foreign_key: String§other_key: String§target_model: String§target_pk: StringTrait Implementations§
Source§impl Clone for BelongsToMany
impl Clone for BelongsToMany
Source§fn clone(&self) -> BelongsToMany
fn clone(&self) -> BelongsToMany
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BelongsToMany
impl RefUnwindSafe for BelongsToMany
impl Send for BelongsToMany
impl Sync for BelongsToMany
impl Unpin for BelongsToMany
impl UnsafeUnpin for BelongsToMany
impl UnwindSafe for BelongsToMany
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