DatabaseValidator

Trait DatabaseValidator 

Source
pub trait DatabaseValidator: Send + Sync {
    // Required methods
    fn exists<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
        column: &'life2 str,
        value: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn is_unique<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
        column: &'life2 str,
        value: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn is_unique_except<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
        column: &'life2 str,
        value: &'life3 str,
        except_id: &'life4 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
}
Expand description

Trait for database validation operations.

Required Methods§

Source

fn exists<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, table: &'life1 str, column: &'life2 str, value: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Check if a value exists in a table column.

Source

fn is_unique<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, table: &'life1 str, column: &'life2 str, value: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Check if a value is unique in a table column.

Source

fn is_unique_except<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, table: &'life1 str, column: &'life2 str, value: &'life3 str, except_id: &'life4 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Check if a value is unique, excluding a specific ID (for updates).

Implementors§