pub trait DeletableModel:
BaseModel
+ Send
+ Sync
+ 'static {
type DeleteOptions: Send + Sync + Default;
// Required methods
fn get_delete_handlers() -> &'static LazyLock<DeleteListenerList<Self>>;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
options: Self::DeleteOptions,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn register_delete_handler<'async_trait, F>(
priority: ListenerPriority,
callback: F,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where F: 'async_trait + for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static,
Self: 'async_trait { ... }
fn blocking_register_delete_handler<F: for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static>(
priority: ListenerPriority,
callback: F,
) { ... }
fn run_delete_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
options: &'life1 Self::DeleteOptions,
state: &'life2 State,
transaction: &'life3 mut Transaction<'life4, Postgres>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
}Required Associated Types§
type DeleteOptions: Send + Sync + Default
Required Methods§
fn get_delete_handlers() -> &'static LazyLock<DeleteListenerList<Self>>
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
options: Self::DeleteOptions,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn register_delete_handler<'async_trait, F>( priority: ListenerPriority, callback: F, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
Sourcefn blocking_register_delete_handler<F: for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static>(
priority: ListenerPriority,
callback: F,
)
fn blocking_register_delete_handler<F: for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )
§Warning
This method will block the current thread if the lock is not available
fn run_delete_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
options: &'life1 Self::DeleteOptions,
state: &'life2 State,
transaction: &'life3 mut Transaction<'life4, Postgres>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
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.