use crate::database::{CompareAndSwapTransaction, DatabaseEntry, TransactionError};
pub trait Deleteable: Sized + DatabaseEntry {
/// Deletes an entry from the database
///
/// This function should be safe way to delete entries from the database, unlinking references and removing `self` from the database, if exists
fn tx_delete(
self,
cas_tx: &mut CompareAndSwapTransaction<Self::Db>,
) -> Result<(), TransactionError> {
cas_tx.tx_remove(self.id())
}
}