[][src]Struct c3p0_pg_async::pg_async::PgC3p0Json

pub struct PgC3p0Json<DATA, CODEC: JsonCodec<DATA>> where
    DATA: Clone + Serialize + DeserializeOwned
{ /* fields omitted */ }

Methods

impl<DATA, CODEC: JsonCodec<DATA>> PgC3p0Json<DATA, CODEC> where
    DATA: Clone + Serialize + DeserializeOwned
[src]

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]

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]

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]

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]

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]

pub async fn create_table_if_not_exists<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection
) -> Result<(), C3p0Error>
[src]

pub async fn drop_table_if_exists<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection,
    cascade: bool
) -> Result<(), C3p0Error>
[src]

pub async fn count_all<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
[src]

pub async fn exists_by_id<'a, '_, '_, ID: Into<&'a IdType>>(
    &'_ self,
    conn: &'_ mut PgConnection,
    id: ID
) -> Result<bool, C3p0Error>
[src]

pub async fn fetch_all<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection
) -> Result<Vec<Model<DATA>>, C3p0Error>
[src]

pub async fn fetch_all_for_update<'_, '_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection,
    for_update: &'_ ForUpdate
) -> Result<Vec<Model<DATA>>, C3p0Error>
[src]

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]

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]

pub async fn delete<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection,
    obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]

pub async fn delete_all<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection
) -> Result<u64, C3p0Error>
[src]

pub async fn delete_by_id<'a, '_, '_, ID: Into<&'a IdType>>(
    &'_ self,
    conn: &'_ mut PgConnection,
    id: ID
) -> Result<u64, C3p0Error>
[src]

pub async fn save<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection,
    obj: NewModel<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]

pub async fn update<'_, '_>(
    &'_ self,
    conn: &'_ mut PgConnection,
    obj: Model<DATA>
) -> Result<Model<DATA>, C3p0Error>
[src]

Trait Implementations

impl<DATA, CODEC: JsonCodec<DATA>> C3p0JsonAsync<DATA, CODEC> for PgC3p0Json<DATA, CODEC> where
    DATA: Clone + Serialize + DeserializeOwned
[src]

type CONN = PgConnection

impl<DATA: Clone, CODEC: Clone + JsonCodec<DATA>> Clone for PgC3p0Json<DATA, CODEC> where
    DATA: Clone + Serialize + DeserializeOwned
[src]

Auto Trait Implementations

impl<DATA, CODEC> RefUnwindSafe for PgC3p0Json<DATA, CODEC> where
    CODEC: RefUnwindSafe,
    DATA: RefUnwindSafe

impl<DATA, CODEC> Send for PgC3p0Json<DATA, CODEC> where
    CODEC: Send,
    DATA: Send

impl<DATA, CODEC> Sync for PgC3p0Json<DATA, CODEC> where
    CODEC: Sync,
    DATA: Sync

impl<DATA, CODEC> Unpin for PgC3p0Json<DATA, CODEC> where
    CODEC: Unpin,
    DATA: Unpin

impl<DATA, CODEC> UnwindSafe for PgC3p0Json<DATA, CODEC> where
    CODEC: UnwindSafe,
    DATA: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,