[][src]Trait diesel::associations::BelongsTo

pub trait BelongsTo<Parent> {
    type ForeignKey: Hash + Eq;
    type ForeignKeyColumn: Column;
    fn foreign_key(&self) -> Option<&Self::ForeignKey>;
fn foreign_key_column() -> Self::ForeignKeyColumn; }

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

The foreign key of this struct

type ForeignKeyColumn: Column

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

Loading content...

Required methods

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

Returns the foreign key for self

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct's table

Loading content...

Implementations on Foreign Types

impl<A, Parent> BelongsTo<Parent> for (A,) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, Parent> BelongsTo<Parent> for (A, B) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, Parent> BelongsTo<Parent> for (A, B, C) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, Parent> BelongsTo<Parent> for (A, B, C, D) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, Parent> BelongsTo<Parent> for (A, B, C, D, E) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, Parent> BelongsTo<Parent> for (A, B, C, D, E, F) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K, L) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K, L, M) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) where
    A: BelongsTo<Parent>, 
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Parent> BelongsTo<Parent> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) where
    A: BelongsTo<Parent>, 
[src]

Loading content...

Implementors

Loading content...