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<'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;

    // Provided methods
    fn register_create_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::CreateOptions<'_>, &'a mut InsertQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static,
             Self: 'async_trait { ... }
    fn blocking_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 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 { ... }
}

Required Associated Types§

Required Methods§

Source

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

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,

Provided Methods§

Source

fn register_create_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::CreateOptions<'_>, &'a mut InsertQueryBuilder<'_>, &'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_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, )

§Warning

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

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,

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 CreatableModel for AdminActivity

Source§

impl CreatableModel for BackupConfiguration

Source§

impl CreatableModel for DatabaseHost

Source§

impl CreatableModel for EggRepository

Source§

impl CreatableModel for Location

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 NodeMount

Source§

impl CreatableModel for OAuthProvider

Source§

impl CreatableModel for Role

Source§

impl CreatableModel for Server

Source§

impl CreatableModel for ServerActivity

Source§

impl CreatableModel for ServerBackup

Source§

impl CreatableModel for ServerDatabase

Source§

impl CreatableModel for ServerMount

Source§

impl CreatableModel for ServerSchedule

Source§

impl CreatableModel for ServerScheduleStep

Source§

impl CreatableModel for ServerSubuser

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