pub enum JoinKind {
BelongsTo {
column: ColumnName,
},
HasOne {
foreign_key: ColumnName,
},
HasMany {
foreign_key: ColumnName,
},
ManyToMany {
through: Through,
},
}Expand description
The relationship a join expresses. The verb carries both the cardinality and — the part that matters — which table holds the key:
BelongsTo: this row points at the related row (columnis on the parent table) → a single object.HasOne/HasMany: the related rows point back at this one (foreign_keyis on the related table) → a single object / a nested array.ManyToMany: both sides are keyed through a junction table → a nested array.
Variants§
BelongsTo
Fields
§
column: ColumnNameHasOne
Fields
§
foreign_key: ColumnNameHasMany
Fields
§
foreign_key: ColumnNameManyToMany
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JoinKind
impl<'de> Deserialize<'de> for JoinKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JoinKind
impl RefUnwindSafe for JoinKind
impl Send for JoinKind
impl Sync for JoinKind
impl Unpin for JoinKind
impl UnsafeUnpin for JoinKind
impl UnwindSafe for JoinKind
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