Skip to main content

CreatableModel

Trait CreatableModel 

Source
pub trait CreatableModel:
    BaseModel
    + Send
    + Sync
    + 'static {
    type CreateOptions<'a>: Send + Sync + Validate;
    type CreateResult: Send;

    // Required methods
    fn get_create_handlers() -> &'static LazyLock<CreateListenerList<Self>>;
    fn create_with_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        state: &'life0 State,
        options: Self::CreateOptions<'life1>,
        transaction: &'life2 mut Transaction<'life3, Postgres>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::CreateResult, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided methods
    fn register_create_handler<F: for<'a> Fn(&'a mut Self::CreateOptions<'_>, &'a mut InsertQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>(
        priority: ListenerPriority,
        callback: F,
    ) { ... }
    fn register_after_create_handler<F: for<'a> Fn(&'a mut Self::CreateResult, &'a Self::CreateOptions<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>(
        priority: ListenerPriority,
        callback: F,
    ) { ... }
    fn run_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        options: &'life0 mut Self::CreateOptions<'life1>,
        query_builder: &'life2 mut InsertQueryBuilder<'_>,
        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 { ... }
    fn run_after_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        result: &'life0 mut Self::CreateResult,
        options: &'life1 Self::CreateOptions<'life2>,
        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 { ... }
    fn create<'life0, 'life1, 'async_trait>(
        state: &'life0 State,
        options: Self::CreateOptions<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::CreateResult, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

Source

fn get_create_handlers() -> &'static LazyLock<CreateListenerList<Self>>

Source

fn create_with_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( state: &'life0 State, options: Self::CreateOptions<'life1>, transaction: &'life2 mut Transaction<'life3, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<Self::CreateResult, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provided Methods§

Source

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

Source

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

Source

fn run_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( options: &'life0 mut Self::CreateOptions<'life1>, query_builder: &'life2 mut InsertQueryBuilder<'_>, 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,

Source

fn run_after_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( result: &'life0 mut Self::CreateResult, options: &'life1 Self::CreateOptions<'life2>, 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,

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl CreatableModel for AdminActivity

Source§

impl CreatableModel for Announcement

Source§

impl CreatableModel for BackupConfiguration

Source§

impl CreatableModel for DatabaseAgentHost

Source§

impl CreatableModel for DatabaseAgentTemplate

Source§

impl CreatableModel for DatabaseHost

Source§

impl CreatableModel for EggConfiguration

Source§

impl CreatableModel for EggRepository

Source§

impl CreatableModel for Location

Source§

impl CreatableModel for LocationDatabaseAgentHost

Source§

impl CreatableModel for LocationDatabaseHost

Source§

impl CreatableModel for Mount

Source§

impl CreatableModel for Nest

Source§

impl CreatableModel for NestEgg

Source§

impl CreatableModel for NestEggMount

Source§

impl CreatableModel for NestEggVariable

Source§

impl CreatableModel for Node

Source§

impl CreatableModel for NodeDatabaseAgentHost

Source§

impl CreatableModel for NodeDatabaseHost

Source§

impl CreatableModel for NodeMount

Source§

impl CreatableModel for OAuthProvider

Source§

impl CreatableModel for OAuthProviderMapping

Source§

impl CreatableModel for Role

Source§

impl CreatableModel for Server

Source§

impl CreatableModel for ServerActivity

Source§

impl CreatableModel for ServerBackup

Source§

impl CreatableModel for ServerBackupGroup

Source§

impl CreatableModel for ServerDatabase

Source§

impl CreatableModel for ServerDatabaseInstance

Source§

impl CreatableModel for ServerMount

Source§

impl CreatableModel for ServerSchedule

Source§

impl CreatableModel for ServerScheduleStep

Source§

impl CreatableModel for ServerSubuser

Source§

impl CreatableModel for SystemBackupPolicy

Source§

impl CreatableModel for SystemBackupPolicyLocation

Source§

impl CreatableModel for SystemBackupPolicyNode

Source§

impl CreatableModel for SystemBackupPolicyServer

Source§

impl CreatableModel for User

Source§

impl CreatableModel for UserActivity

Source§

impl CreatableModel for UserApiKey

Source§

impl CreatableModel for UserCommandSnippet

Source§

impl CreatableModel for UserSecurityKey

Source§

impl CreatableModel for UserServerGroup

Source§

impl CreatableModel for UserSession

Source§

impl CreatableModel for UserSshKey