Trait ConnectionHolder

Source
pub trait ConnectionHolder {
    // Required methods
    fn get_connection(&self) -> &DbConn;
    fn get_connection_ref(&self) -> Arc<DbConn>;
    fn get_connection_raw(&self) -> *const DbConn;
}

Required Methods§

Source

fn get_connection(&self) -> &DbConn

Returns the internal database connection as a reference to a DbConn object. This actually returns a case of the internal Arc reference, for ease of use.

Source

fn get_connection_ref(&self) -> Arc<DbConn>

Returns the internal database connection. This will return the Arc reference that contains the connection object or pool.

Source

fn get_connection_raw(&self) -> *const DbConn

Returns a constant database connection. This is to enforce memory safety because sea_orm’s native DbConn does not implement Send or Sync.

Implementors§