DeletableEntity

Trait DeletableEntity 

Source
pub trait DeletableEntity {
    // Required method
    fn delete<'a>(
        &self,
        executor: impl PgExecutor<'a>,
    ) -> impl Future<Output = Result<(), Error>>;
}
Expand description

Trait for types that can be deleted from the database. This trait is implemented for the entity struct, allowing you to delete a row by its primary key(s).

Required Methods§

Source

fn delete<'a>( &self, executor: impl PgExecutor<'a>, ) -> impl Future<Output = Result<(), Error>>

Delete the entity from the database by its primary key(s).

§Arguments
  • pool - A reference to a PostgreSQL connection pool.
§Returns

A future resolving to () if successful, or a SQLx error.

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.

Implementors§