pub enum RelationKind {
BelongsTo,
HasMany,
HasOne,
}Expand description
How a generated model relates to another one.
The whole point of naming these is that picking the kind and the target
is all the information a relation needs — the foreign key, the column it
maps to, and the pairing are conventions #[phoenix::model] fills in.
Variants§
BelongsTo
This model holds the foreign key (Post → User).
HasMany
The other model holds the foreign key, and there are many (User → Post).
HasOne
The other model holds the foreign key, and there is at most one.
Implementations§
Trait Implementations§
Source§impl Clone for RelationKind
impl Clone for RelationKind
impl Copy for RelationKind
Source§impl Debug for RelationKind
impl Debug for RelationKind
impl Eq for RelationKind
Source§impl PartialEq for RelationKind
impl PartialEq for RelationKind
impl StructuralPartialEq for RelationKind
Auto Trait Implementations§
impl Freeze for RelationKind
impl RefUnwindSafe for RelationKind
impl Send for RelationKind
impl Sync for RelationKind
impl Unpin for RelationKind
impl UnsafeUnpin for RelationKind
impl UnwindSafe for RelationKind
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