1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use super::*; /// Trait contract for the Repo [`delete_by_id`] method /// /// [`delete_by_id`]: Repo::delete_by_id /// --- pub trait DeleteById<T: Entity>: Repo { fn exec( &self, id: T::ID, ) -> impl Future<Output = Result<DeleteStatus, ::anyhow::Error>> + Send; } #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum DeleteStatus { NotFound, Deleted, }