pub trait ModelBuilder<'a, DB>{
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§
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>,
Sourcefn modified_fields(&self) -> Vec<&'static str>
fn modified_fields(&self) -> Vec<&'static str>
All fields that will be modified in the query.
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.