pub enum RelationKey<'a> {
Local(&'a ColumnName),
Direct(&'a ColumnName),
Through(&'a Through),
}Expand description
A relation’s key, viewed uniformly across joins and aggregates — the three physical shapes a “these tables connect” fact can take. Traversal code (document SQL, reverse resolution) matches on this instead of caring whether the relation is a join or an aggregate.
Variants§
Local(&'a ColumnName)
The parent row holds the key: parent.column → target.primary_key
(a belongs_to).
Direct(&'a ColumnName)
The related rows hold the key: target.foreign_key → parent.pk
(a has_one/has_many, or a direct-keyed aggregate).
Through(&'a Through)
Both sides connect through a junction table.
Trait Implementations§
Source§impl<'a> Clone for RelationKey<'a>
impl<'a> Clone for RelationKey<'a>
Source§fn clone(&self) -> RelationKey<'a>
fn clone(&self) -> RelationKey<'a>
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 moreimpl<'a> Copy for RelationKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for RelationKey<'a>
impl<'a> RefUnwindSafe for RelationKey<'a>
impl<'a> Send for RelationKey<'a>
impl<'a> Sync for RelationKey<'a>
impl<'a> Unpin for RelationKey<'a>
impl<'a> UnsafeUnpin for RelationKey<'a>
impl<'a> UnwindSafe for RelationKey<'a>
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