Skip to main content

DuplicableModel

Trait DuplicableModel 

Source
pub trait DuplicableModel:
    BaseModel
    + Send
    + Sync
    + 'static {
    type DuplicateOptions<'a>: Send + Sync + Validate;

    // Required methods
    fn get_duplicate_handlers() -> &'static LazyLock<DuplicateHandlerList<Self>>;
    fn duplicate_with_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        state: &'life1 State,
        options: Self::DuplicateOptions<'life2>,
        transaction: &'life3 mut Transaction<'life4, Postgres>,
    ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;

    // Provided methods
    fn register_duplicate_handler<F: for<'a> Fn(&'a Self, &'a Self::DuplicateOptions<'_>, &'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_duplicate_handler<F: for<'a> Fn(&'a Self, &'a mut Self, &'a Self::DuplicateOptions<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>(
        priority: ListenerPriority,
        callback: F,
    ) { ... }
    fn run_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        options: &'life1 Self::DuplicateOptions<'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 run_after_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
        &'life0 self,
        duplicated: &'life1 mut Self,
        options: &'life2 Self::DuplicateOptions<'life3>,
        state: &'life4 State,
        transaction: &'life5 mut Transaction<'life6, 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,
             'life6: 'async_trait { ... }
    fn duplicate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 State,
        options: Self::DuplicateOptions<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Required Associated Types§

Source

type DuplicateOptions<'a>: Send + Sync + Validate

Required Methods§

Source

fn get_duplicate_handlers() -> &'static LazyLock<DuplicateHandlerList<Self>>

Source

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

Provided Methods§

Source

fn register_duplicate_handler<F: for<'a> Fn(&'a Self, &'a Self::DuplicateOptions<'_>, &'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_duplicate_handler<F: for<'a> Fn(&'a Self, &'a mut Self, &'a Self::DuplicateOptions<'_>, &'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_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, options: &'life1 Self::DuplicateOptions<'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 run_after_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, duplicated: &'life1 mut Self, options: &'life2 Self::DuplicateOptions<'life3>, state: &'life4 State, transaction: &'life5 mut Transaction<'life6, 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, 'life6: 'async_trait,

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl DuplicableModel for Announcement

Source§

impl DuplicableModel for BackupConfiguration

Source§

impl DuplicableModel for DatabaseAgentTemplate

Source§

impl DuplicableModel for EggConfiguration

Source§

impl DuplicableModel for Location

Source§

impl DuplicableModel for Mount

Source§

impl DuplicableModel for NestEgg

Source§

impl DuplicableModel for NestEggVariable

Source§

impl DuplicableModel for Node

Source§

impl DuplicableModel for OAuthProvider

Source§

impl DuplicableModel for Role

Source§

impl DuplicableModel for ServerSchedule

Source§

impl DuplicableModel for ServerScheduleStep

Source§

impl DuplicableModel for UserCommandSnippet