Trait diesel::associations::BelongsTo

source ·
pub trait BelongsTo<Parent> {
    type ForeignKey: Hash + Eq;
    type ForeignKeyColumn: Column;

    // Required methods
    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

Required Associated Types§

source

type ForeignKey: Hash + Eq

The foreign key of this struct

source

type ForeignKeyColumn: Column

The database column representing the foreign key of the table this struct represents

Required Methods§

source

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self

source

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T0, Parent> BelongsTo<Parent> for (T0,)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, Parent> BelongsTo<Parent> for (T0, T1)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, Parent> BelongsTo<Parent> for (T0, T1, T2)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, Parent> BelongsTo<Parent> for (T0, T1, T2, T3)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30)
where T0: BelongsTo<Parent>,

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, Parent> BelongsTo<Parent> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31)
where T0: BelongsTo<Parent>,

Implementors§