[][src]Enum diesel_factories::Association

pub enum Association<'a, Model, Factory> {
    Model(&'a Model),
    Factory(Factory),
}

A "belongs to" association that may or may not have been inserted yet.

You will normally be using this when setting up "belongs to" associations between models in factories.

Variants

Model(&'a Model)

An associated model that has been inserted into the database.

You shouldn't have to use this direclty but instead just Association::default().

Factory(Factory)

A factory for a model that hasn't been inserted yet into the database.

You shouldn't have to use this direclty but instead just Association::default().

Trait Implementations

impl<'_, Model, Factory: Default> Default for Association<'_, Model, Factory>[src]

impl<'a, Model: Clone, Factory: Clone> Clone for Association<'a, Model, Factory>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a, Model: Debug, Factory: Debug> Debug for Association<'a, Model, Factory>[src]

Auto Trait Implementations

impl<'a, Model, Factory> Send for Association<'a, Model, Factory> where
    Factory: Send,
    Model: Sync

impl<'a, Model, Factory> Unpin for Association<'a, Model, Factory> where
    Factory: Unpin

impl<'a, Model, Factory> Sync for Association<'a, Model, Factory> where
    Factory: Sync,
    Model: Sync

impl<'a, Model, Factory> UnwindSafe for Association<'a, Model, Factory> where
    Factory: UnwindSafe,
    Model: RefUnwindSafe

impl<'a, Model, Factory> RefUnwindSafe for Association<'a, Model, Factory> where
    Factory: RefUnwindSafe,
    Model: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]