Skip to main content

SGBD

Trait SGBD 

Source
pub trait SGBD: Clone {
    type Pool;

    // Required methods
    fn new<'async_trait>(
        connection_url: impl AsRef<str> + ToString + Send + Sync + 'async_trait,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn create_pool<'async_trait>(
        url: impl AsRef<str> + Send + Sync + 'async_trait,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn pool(&self) -> &Self::Pool;
}

Required Associated Types§

Required Methods§

Source

fn new<'async_trait>( connection_url: impl AsRef<str> + ToString + Send + Sync + 'async_trait, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Ouvre une connexion immédiate à la base de données.

Source

fn create_pool<'async_trait>( url: impl AsRef<str> + Send + Sync + 'async_trait, ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Ouvre une pool de connexion à partir d’une URL.

Source

fn pool(&self) -> &Self::Pool

Pool de connexion de la base de données.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§