Trait diesel::associations::BelongsTo [−][src]
pub trait BelongsTo<Parent> { type ForeignKey: Hash + Eq; type ForeignKeyColumn: Column; fn foreign_key(&self) -> Option<&Self::ForeignKey>; fn foreign_key_column() -> Self::ForeignKeyColumn; }
Expand description
Indicates that a type belongs to Parent
Specifically, this means that this struct has fields
which correspond to the primary key of Parent
.
This implies that a foreign key relationship exists on the tables.
This trait is not capable of supporting composite foreign keys
Associated Types
type ForeignKey: Hash + Eq
[src]
type ForeignKey: Hash + Eq
[src]The foreign key of this struct
type ForeignKeyColumn: Column
[src]
type ForeignKeyColumn: Column
[src]The database column representing the foreign key of the table this struct represents
Required methods
fn foreign_key(&self) -> Option<&Self::ForeignKey>
[src]
fn foreign_key(&self) -> Option<&Self::ForeignKey>
[src]Returns the foreign key for self
fn foreign_key_column() -> Self::ForeignKeyColumn
[src]
fn foreign_key_column() -> Self::ForeignKeyColumn
[src]Returns the foreign key column of this struct’s table
Implementations on Foreign Types
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn
type ForeignKey = A::ForeignKey
type ForeignKeyColumn = A::ForeignKeyColumn