pub trait DBEntity: Send {
const TABLE: &'static str;
Show 13 methods
// Required methods
fn create_table<'life0, 'async_trait>(
pool: &'life0 SqlitePool
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait;
fn get<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_with_txn<'t, 'life0, 'life1, 'async_trait>(
_txn: &'life0 mut SqliteConnection,
_id: &'life1 i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_by_name<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_all_by_name<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<Self>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_all_user<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<Self>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_with_txn<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn json(&self) -> Result<String, String>
where Self: Serialize { ... }
}
Required Associated Constants§
Required Methods§
fn create_table<'life0, 'async_trait>(
pool: &'life0 SqlitePool
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
sourcefn get<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the entity
fn get_with_txn<'t, 'life0, 'life1, 'async_trait>(
_txn: &'life0 mut SqliteConnection,
_id: &'life1 i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_by_name<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_by_name<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<Self>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_user<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<Self>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
save the entity to the database
sourcefn save_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
save the entity to the database, but you’re in a transaction
sourcefn create_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
create from scratch
sourcefn update_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
create from scratch
sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
delete the entity from the database
sourcefn delete_with_txn<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_with_txn<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
delete the entity from the database, but you’re in a transaction
Provided Methods§
Object Safety§
This trait is not object safe.