UpdatableModel

Trait UpdatableModel 

Source
pub trait UpdatableModel:
    BaseModel
    + Send
    + Sync
    + 'static {
    type UpdateOptions: Send + Sync + Default + ToSchema + DeserializeOwned + Serialize + Validate;

    // Required methods
    fn get_update_handlers() -> &'static LazyLock<UpdateListenerList<Self>>;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        state: &'life1 State,
        options: Self::UpdateOptions,
    ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn register_update_handler<'async_trait, F>(
        priority: ListenerPriority,
        callback: F,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where F: 'async_trait + for<'a> Fn(&'a mut Self, &'a mut Self::UpdateOptions, &'a mut UpdateQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static,
             Self: 'async_trait { ... }
    fn blocking_register_update_handler<F: for<'a> Fn(&'a mut Self, &'a mut Self::UpdateOptions, &'a mut UpdateQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>(
        priority: ListenerPriority,
        callback: F,
    ) { ... }
    fn run_update_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 mut self,
        options: &'life1 mut Self::UpdateOptions,
        query_builder: &'life2 mut UpdateQueryBuilder<'_>,
        state: &'life3 State,
        transaction: &'life4 mut Transaction<'life5, Postgres>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait { ... }
}

Required Associated Types§

Source

type UpdateOptions: Send + Sync + Default + ToSchema + DeserializeOwned + Serialize + Validate

Required Methods§

Source

fn get_update_handlers() -> &'static LazyLock<UpdateListenerList<Self>>

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 mut self, state: &'life1 State, options: Self::UpdateOptions, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn register_update_handler<'async_trait, F>( priority: ListenerPriority, callback: F, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where F: 'async_trait + for<'a> Fn(&'a mut Self, &'a mut Self::UpdateOptions, &'a mut UpdateQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static, Self: 'async_trait,

Source

fn blocking_register_update_handler<F: for<'a> Fn(&'a mut Self, &'a mut Self::UpdateOptions, &'a mut UpdateQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

§Warning

This method will block the current thread if the lock is not available

Source

fn run_update_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 mut self, options: &'life1 mut Self::UpdateOptions, query_builder: &'life2 mut UpdateQueryBuilder<'_>, state: &'life3 State, transaction: &'life4 mut Transaction<'life5, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: '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.

Implementors§

Source§

impl UpdatableModel for BackupConfiguration

Source§

impl UpdatableModel for DatabaseHost

Source§

impl UpdatableModel for EggRepository

Source§

impl UpdatableModel for Location

Source§

impl UpdatableModel for Mount

Source§

impl UpdatableModel for Nest

Source§

impl UpdatableModel for NestEgg

Source§

impl UpdatableModel for NestEggVariable

Source§

impl UpdatableModel for Node

Source§

impl UpdatableModel for OAuthProvider

Source§

impl UpdatableModel for Role

Source§

impl UpdatableModel for Server

Source§

impl UpdatableModel for ServerBackup

Source§

impl UpdatableModel for ServerDatabase

Source§

impl UpdatableModel for ServerSchedule

Source§

impl UpdatableModel for ServerScheduleStep

Source§

impl UpdatableModel for ServerSubuser

Source§

impl UpdatableModel for User

Source§

impl UpdatableModel for UserApiKey

Source§

impl UpdatableModel for UserCommandSnippet

Source§

impl UpdatableModel for UserSecurityKey

Source§

impl UpdatableModel for UserServerGroup

Source§

impl UpdatableModel for UserSshKey