Trait c3p0_common::json::C3p0Json
source · pub trait C3p0Json<Id, Data, Codec>: Clone + Send + Sync{
type Tx;
Show 13 methods
// Required methods
fn codec(&self) -> &Codec;
fn create_table_if_not_exists(
&self,
tx: &mut Self::Tx
) -> impl Future<Output = Result<(), C3p0Error>> + Send;
fn drop_table_if_exists(
&self,
tx: &mut Self::Tx,
cascade: bool
) -> impl Future<Output = Result<(), C3p0Error>> + Send;
fn count_all(
&self,
tx: &mut Self::Tx
) -> impl Future<Output = Result<u64, C3p0Error>> + Send;
fn exists_by_id(
&self,
tx: &mut Self::Tx,
id: &Id
) -> impl Future<Output = Result<bool, C3p0Error>> + Send;
fn fetch_all(
&self,
tx: &mut Self::Tx
) -> impl Future<Output = Result<Vec<Model<Id, Data>>, C3p0Error>> + Send;
fn fetch_one_optional_by_id(
&self,
tx: &mut Self::Tx,
id: &Id
) -> impl Future<Output = Result<Option<Model<Id, Data>>, C3p0Error>> + Send;
fn fetch_one_by_id(
&self,
tx: &mut Self::Tx,
id: &Id
) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send;
fn delete(
&self,
tx: &mut Self::Tx,
obj: Model<Id, Data>
) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send;
fn delete_all(
&self,
tx: &mut Self::Tx
) -> impl Future<Output = Result<u64, C3p0Error>> + Send;
fn delete_by_id(
&self,
tx: &mut Self::Tx,
id: &Id
) -> impl Future<Output = Result<u64, C3p0Error>> + Send;
fn save(
&self,
tx: &mut Self::Tx,
obj: NewModel<Data>
) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send;
fn update(
&self,
tx: &mut Self::Tx,
obj: Model<Id, Data>
) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send;
}
Required Associated Types§
Required Methods§
fn codec(&self) -> &Codec
fn create_table_if_not_exists( &self, tx: &mut Self::Tx ) -> impl Future<Output = Result<(), C3p0Error>> + Send
fn drop_table_if_exists( &self, tx: &mut Self::Tx, cascade: bool ) -> impl Future<Output = Result<(), C3p0Error>> + Send
fn count_all( &self, tx: &mut Self::Tx ) -> impl Future<Output = Result<u64, C3p0Error>> + Send
fn exists_by_id( &self, tx: &mut Self::Tx, id: &Id ) -> impl Future<Output = Result<bool, C3p0Error>> + Send
fn fetch_all( &self, tx: &mut Self::Tx ) -> impl Future<Output = Result<Vec<Model<Id, Data>>, C3p0Error>> + Send
fn fetch_one_optional_by_id( &self, tx: &mut Self::Tx, id: &Id ) -> impl Future<Output = Result<Option<Model<Id, Data>>, C3p0Error>> + Send
fn fetch_one_by_id( &self, tx: &mut Self::Tx, id: &Id ) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send
fn delete( &self, tx: &mut Self::Tx, obj: Model<Id, Data> ) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send
fn delete_all( &self, tx: &mut Self::Tx ) -> impl Future<Output = Result<u64, C3p0Error>> + Send
fn delete_by_id( &self, tx: &mut Self::Tx, id: &Id ) -> impl Future<Output = Result<u64, C3p0Error>> + Send
fn save( &self, tx: &mut Self::Tx, obj: NewModel<Data> ) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send
fn update( &self, tx: &mut Self::Tx, obj: Model<Id, Data> ) -> impl Future<Output = Result<Model<Id, Data>, C3p0Error>> + Send
Object Safety§
This trait is not object safe.