[−][src]Struct c3p0_pg_async::pg_async::PgC3p0Json
Methods
impl<DATA, CODEC: JsonCodec<DATA>> PgC3p0Json<DATA, CODEC> where
DATA: Clone + Serialize + DeserializeOwned,
[src]
DATA: Clone + Serialize + DeserializeOwned,
pub fn queries(&self) -> &Queries
[src]
pub fn to_model(&self, row: &Row) -> Result<Model<DATA>, Box<dyn Error>>
[src]
pub async fn fetch_one_optional_with_sql<'_, '_, '_, '_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Option<Model<DATA>>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Option<Model<DATA>>, C3p0Error>
Allows the execution of a custom sql query and returns the first entry in the result set. For this to work, the sql query:
- must be a SELECT
- must declare the ID, VERSION and DATA fields in this exact order
pub async fn fetch_one_with_sql<'_, '_, '_, '_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Model<DATA>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Model<DATA>, C3p0Error>
Allows the execution of a custom sql query and returns the first entry in the result set. For this to work, the sql query:
- must be a SELECT
- must declare the ID, VERSION and DATA fields in this exact order
pub async fn fetch_all_with_sql<'_, '_, '_, '_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Vec<Model<DATA>>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
sql: &'_ str,
params: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<Vec<Model<DATA>>, C3p0Error>
Allows the execution of a custom sql query and returns all the entries in the result set. For this to work, the sql query:
- must be a SELECT
- must declare the ID, VERSION and DATA fields in this exact order
pub async fn fetch_one_by_id<'a, '_, ID: Into<&'a IdType>>(
&'a self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<Model<DATA>, C3p0Error>
[src]
&'a self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<Model<DATA>, C3p0Error>
pub async fn fetch_one_by_id_for_update<'a, '_, '_, ID: Into<&'a IdType>>(
&'a self,
conn: &'_ mut PgConnection,
id: ID,
for_update: &'_ ForUpdate
) -> Result<Model<DATA>, C3p0Error>
[src]
&'a self,
conn: &'_ mut PgConnection,
id: ID,
for_update: &'_ ForUpdate
) -> Result<Model<DATA>, C3p0Error>
pub async fn create_table_if_not_exists<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection
) -> Result<(), C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection
) -> Result<(), C3p0Error>
pub async fn drop_table_if_exists<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
cascade: bool
) -> Result<(), C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
cascade: bool
) -> Result<(), C3p0Error>
pub async fn count_all<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
pub async fn exists_by_id<'a, '_, '_, ID: Into<&'a IdType>>(
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<bool, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<bool, C3p0Error>
pub async fn fetch_all<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection
) -> Result<Vec<Model<DATA>>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection
) -> Result<Vec<Model<DATA>>, C3p0Error>
pub async fn fetch_all_for_update<'_, '_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
for_update: &'_ ForUpdate
) -> Result<Vec<Model<DATA>>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
for_update: &'_ ForUpdate
) -> Result<Vec<Model<DATA>>, C3p0Error>
pub async fn fetch_one_optional_by_id<'a, '_, '_, ID: Into<&'a IdType>>(
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<Option<Model<DATA>>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<Option<Model<DATA>>, C3p0Error>
pub async fn fetch_one_optional_by_id_for_update<'a, '_, '_, ID: Into<&'a IdType>>(
&'a self,
conn: &'_ mut PgConnection,
id: ID,
for_update: &'_ ForUpdate
) -> Result<Option<Model<DATA>>, C3p0Error>
[src]
&'a self,
conn: &'_ mut PgConnection,
id: ID,
for_update: &'_ ForUpdate
) -> Result<Option<Model<DATA>>, C3p0Error>
pub async fn delete<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
pub async fn delete_all<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
pub async fn delete_by_id<'a, '_, '_, ID: Into<&'a IdType>>(
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<u64, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
id: ID
) -> Result<u64, C3p0Error>
pub async fn save<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
obj: NewModel<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
obj: NewModel<DATA>
) -> Result<Model<DATA>, C3p0Error>
pub async fn update<'_, '_>(
&'_ self,
conn: &'_ mut PgConnection,
obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]
&'_ self,
conn: &'_ mut PgConnection,
obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
Trait Implementations
impl<DATA, CODEC: JsonCodec<DATA>> C3p0JsonAsync<DATA, CODEC> for PgC3p0Json<DATA, CODEC> where
DATA: Clone + Serialize + DeserializeOwned,
[src]
DATA: Clone + Serialize + DeserializeOwned,
type CONN = PgConnection
fn codec(&self) -> &CODEC
[src]
impl<DATA: Clone, CODEC: Clone + JsonCodec<DATA>> Clone for PgC3p0Json<DATA, CODEC> where
DATA: Clone + Serialize + DeserializeOwned,
[src]
DATA: Clone + Serialize + DeserializeOwned,
fn clone(&self) -> PgC3p0Json<DATA, CODEC>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<DATA, CODEC> RefUnwindSafe for PgC3p0Json<DATA, CODEC> where
CODEC: RefUnwindSafe,
DATA: RefUnwindSafe,
CODEC: RefUnwindSafe,
DATA: RefUnwindSafe,
impl<DATA, CODEC> Send for PgC3p0Json<DATA, CODEC> where
CODEC: Send,
DATA: Send,
CODEC: Send,
DATA: Send,
impl<DATA, CODEC> Sync for PgC3p0Json<DATA, CODEC> where
CODEC: Sync,
DATA: Sync,
CODEC: Sync,
DATA: Sync,
impl<DATA, CODEC> Unpin for PgC3p0Json<DATA, CODEC> where
CODEC: Unpin,
DATA: Unpin,
CODEC: Unpin,
DATA: Unpin,
impl<DATA, CODEC> UnwindSafe for PgC3p0Json<DATA, CODEC> where
CODEC: UnwindSafe,
DATA: UnwindSafe,
CODEC: UnwindSafe,
DATA: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,