Skip to main content

Factory

Trait Factory 

Source
pub trait Factory: Sized {
    type Model;

    // Required method
    fn create<C: ConnectionTrait>(
        self,
        connection: &C,
    ) -> impl Future<Output = Result<Self::Model>> + Send;
}
Expand description

An application-owned record builder. Implement with native SeaORM operations. Passing a borrowed connection permits both a pool and an existing transaction.

Required Associated Types§

Source

type Model

The record produced by this factory, usually an application model.

Required Methods§

Source

fn create<C: ConnectionTrait>( self, connection: &C, ) -> impl Future<Output = Result<Self::Model>> + Send

Insert through the supplied connection; never acquire a different pool internally.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§