pub enum HasKind {
Direct(FieldId),
Via(Via),
}Expand description
How a HasMany or HasOne relation reaches its target.
Both relation kinds share this: the question — “is the target reached
through a paired BelongsTo, or by following a path?” — is the same for
has-many and has-one.
Variants§
Direct(FieldId)
The target is reached through a BelongsTo field on the target model.
Carries that paired BelongsTo field’s id.
If a #[has_many(pair = <field>)] / #[has_one(pair = <field>)] was
supplied, the macro resolves the id at schema-construction time.
Otherwise the linker fills it in by searching the target model for a
unique BelongsTo back to the source.
Via(Via)
The target is reached by following a Via path of existing
relations rather than pairing with a single BelongsTo.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HasKind
impl RefUnwindSafe for HasKind
impl Send for HasKind
impl Sync for HasKind
impl Unpin for HasKind
impl UnsafeUnpin for HasKind
impl UnwindSafe for HasKind
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