pub struct MockBackend;
Trait Implementations§
Source§impl Clone for MockBackend
impl Clone for MockBackend
Source§fn clone(&self) -> MockBackend
fn clone(&self) -> MockBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DatabaseBackend for MockBackend
impl DatabaseBackend for MockBackend
type Connection = MockConnection
type Pool = MockPool
type Error = MockError
fn new<'async_trait>(
_config: DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection to the given database
This is useful for cases where a full pool is not needed
Source§fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection using a connection string directly
This is useful for connecting to databases that may not have been created by TestKit
Source§fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new connection pool for the given database
Source§fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_pool: &'life1 Self::Pool,
_name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_pool: &'life1 Self::Pool,
_name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new database with the given name
Source§fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
Drop a database with the given name
Source§fn connection_string(&self, _name: &DatabaseName) -> String
fn connection_string(&self, _name: &DatabaseName) -> String
Get the connection string for the given database
Source§impl Debug for MockBackend
impl Debug for MockBackend
Source§impl Default for MockBackend
impl Default for MockBackend
Source§fn default() -> MockBackend
fn default() -> MockBackend
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockBackend
impl RefUnwindSafe for MockBackend
impl Send for MockBackend
impl Sync for MockBackend
impl Unpin for MockBackend
impl UnwindSafe for MockBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more