Trait ModelBuilder

Source
pub trait ModelBuilder<'a, DB>
where Self: Sized + Send + Sync, DB: Database,
{ type Model; // Required methods fn insert<'e: 'a, E>(self, db: E) -> BoxFuture<'a, Result<Self::Model>> where E: 'e + Executor<'e, Database = DB>; fn update<'e: 'a, E>(self, db: E) -> BoxFuture<'a, Result<Self::Model>> where E: 'e + Executor<'e, Database = DB>; fn modified_fields(&self) -> Vec<&'static str>; fn build(self) -> Self::Model; }
Expand description

A struct that implements ModelBuilder implements the builder pattern for a model.

Required Associated Types§

Required Methods§

Source

fn insert<'e: 'a, E>(self, db: E) -> BoxFuture<'a, Result<Self::Model>>
where E: 'e + Executor<'e, Database = DB>,

Source

fn update<'e: 'a, E>(self, db: E) -> BoxFuture<'a, Result<Self::Model>>
where E: 'e + Executor<'e, Database = DB>,

Source

fn modified_fields(&self) -> Vec<&'static str>

All fields that will be modified in the query.

Source

fn build(self) -> Self::Model

Build the model, don’t insert or update it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§